xanhacks - HitchHack 2023
https://slides.com/xanhacks/dom-clobbering/
image: https://portswigger.net/research/dom-clobbering-strikes-back
Define (and occasionally manipulates)
Javascript variables from HTML
You do not write JS code, you can only manipulate a variable that has not been defined.
index.html
script.js
HTML Injection
Vulnerable JS (sink)
Example n°1 - Redirection
Text
index.html
script.js
HTML Injection
Vulnerable JS (sink)
Example n°2 - JS Execution
Prerequisites : HTML Injection & JS Sink
Goal : JavaScript execution
Advantages
Disadvantage
Theory
Some HTML attributes
https://github.com/xanhacks/DOM-Clobbering-Generator/
id or name
We can also create a variable using the name property, but this works only for:
embed
, form
, iframe
, image
, img
, object
Three levels
We can use form to clobber variables at a depth of 3
first.second.third
More than three levels
We can use iframe to clobber variables at a depth of 4 and more
first.second.third.fourth first.second.third.fourth.fifth...
[html-janitor] Arbitrary HTML can bypass the sanitization process
https://hackerone.com/reports/308158
@xanhacks
https://www.offensiveweb.com/
End! Question?