diff --git a/Dom Clobbering.md b/Dom Clobbering.md new file mode 100644 index 0000000..67ec97b --- /dev/null +++ b/Dom Clobbering.md @@ -0,0 +1,229 @@ +# Dom Clobbering +DOM Clobbering is a technique where global variables can be overwritten or "clobbered" by naming HTML elements with certain IDs or names. This can cause unexpected behavior in scripts and potentially lead to security vulnerabilities. + +## Basic +It's possible to generate global variables inside the JS context with the attributes `id` and `name` in HTML tags. +```javascript +
+ +``` + +**Only** certain elements can use the name attribute to **clobber globals**, they are: +* `embed` +* `form` +* `iframe` +* `image` +* `img` +* `object` + + + +## Exploit +Exploitation requires any kind of HTML injection in the page. + +* Clobbering `x.y.value` +```javascript +// Payload +