HTML Manipulation Sinks
HTML Manipulation Sinks
Browser JavaScript execution sinks
The following operations allow HTML manipulation. If it is possible to control, even partially, the vulnerable argument, then it is possible to manipulate, to some extent the HTML and consequently, gain control of the user interface or execute JavaScript using classic Cross Site Scripting attacks.
document.write
any
All
document.write("htmlString"+ usercontrolledVal)
document.writeln
any
All
document.writeln("htmlString"+ usercontrolledVal)
anyElement.innerHTML
assigned value
All
divEl.innerHTML = "htmlString"+ usercontrolledVal
Range.createContextualFragment
first arg
All
range.createContextualFragment("htmlString"+ usercontrolledVal )
HTMLButton.value
assigned value
Explorer
buttonTag.value = "htmlString"+ usercontrolledVal
Equivalent to buttonTag.innerHTML assignment case
Note:
anymeans that the sink can accept any type of input.anyElementrefers to any HTML element that has aninnerHTMLproperty.usercontrolledValrefers to any value that is controlled by the user, which can be manipulated to introduce XSS attacks.The
Notecolumn provides additional context or caveats for each sink.The
Browsercolumn indicates which browsers are affected by the XSS vulnerability.The
Examplecolumn shows an example of how the XSS vulnerability can be exploited.
Last updated