# 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