Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Attribute based XSS #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ function articleElement(title, lastReply) {
function activeUsersTemplate(name, avatar) {

var safeName = _xssFilters2.default.inHTMLData(name);
var safeAvatar = _xssFilters2.default.inHTMLData(avatar);
var safeAvatar = _xssFilters2.default.inDoubleQuotedAttr(avatar);

var template = "\n <div class=\"active-avatar\">\n <img width=\"54\" src=\"assets/images/" + safeAvatar + "\">\n <h5 class=\"post-author\">" + safeName + "</h5>\n </div>";

Expand Down
2 changes: 1 addition & 1 deletion server/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"activeUsers": [
{
"name": "Sam",
"avatar": "avatar.jpg"
"avatar": "avatar.jpg#\" onload=\"alert('XSS Attack')\""
},
{
"name": "Tyler",
Expand Down
2 changes: 1 addition & 1 deletion src/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function articleElement(title, lastReply){
function activeUsersTemplate(name, avatar){

let safeName = xss.inHTMLData(name);
let safeAvatar = xss.inHTMLData(avatar);
let safeAvatar = xss.inDoubleQuotedAttr(avatar);

let template = `
<div class="active-avatar">
Expand Down