Skip to content

Commit 37bed83

Browse files
committed
Added test case for unescape.
1 parent 40903a9 commit 37bed83

File tree

1 file changed

+10
-0
lines changed
  • javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss

1 file changed

+10
-0
lines changed

javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/tst.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,3 +493,13 @@ function nonGlobalSanitizer() {
493493
$("#foo").html(target.replace(new RegExp("<|>", unknownFlags()), '')); // OK - most likely good. We don't know what the flags are.
494494
$("#foo").html(target.replace(new RegExp("<|>", "g"), ''));
495495
}
496+
497+
function FooBar() {
498+
this.foo = document;
499+
var obj = {
500+
bar: function() {
501+
this.foo.body.innerHTML = unescape(window.location.hash); // $ MISSING: Alert
502+
}
503+
};
504+
Object.assign(this, obj);
505+
}

0 commit comments

Comments
 (0)