DOM Based

Payloads

Scripts

Test execution

alert(1)
alert(window.location.href)
alert(document.domain)
console.log("pwned")
print()

Injection vectors

document

document.write()
document.writeln()
document.domain

Allows execution of <script> blocks

"><svg onload="...">
"><script>...</script>

element

Prevents execution of <script> and SVG blocks use onload/onerror JS calls to run code

Dynamic href

Anchors whose links are controlled by params read by JS scripts can be hijacked

$(...) with hashchange event

AngularJS ng-app

Last updated