--- name: payloads-dom-clobbering description: "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. - Comprehensive List of DOM Clobbering Payloads for Mobile and Desktop Web Browsers - A web-based tool designed for testing various HTML parsers and sanitizers. -..." --- # DOM Clobbering Payloads > **Source:** [PayloadsAllTheThings/DOM Clobbering](https://github.com/swisskyrepo/payloadsallthethings/tree/master/DOM%20Clobbering) > **Category:** `payloads-research` | **Skill ID:** `payloads-dom-clobbering` ## Overview DOM clobbering attack payloads for overriding globals and enabling XSS via named elements. This skill integrates the full **PayloadsAllTheThings** (PATT) payload library for the **DOM Clobbering Payloads** domain into the REA_Skill framework. Use it during authorized penetration testing, bug bounty research, security audits, and CTF challenges. ## Workflow ### 1. Recon & Identification - Identify the target technology stack and injection points - Enumerate endpoints, parameters, and input vectors - Determine applicable payload categories from the reference below ### 2. Payload Selection - Browse the PATT payload library for the attack class - Select encoding-appropriate payloads for the target environment - Consider WAF bypass variants and obfuscation techniques ### 3. Exploitation (Authorized Only) - Test payloads in order: passive → active → escalation - Document every payload tested and its response - Capture PoC evidence (screenshots, HTTP logs, curl output) ### 4. Verification & Reporting - Confirm the vulnerability with a clean minimal PoC - Map findings to CVE/CWE where applicable - Report with remediation recommendations and code fixes --- ## Full PATT Reference # 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. ## Summary - [Tools](#tools) - [Methodology](#methodology) - [Labs](#labs) - [References](#references) ## Tools - [SoheilKhodayari/DOMClobbering](https://domclob.xyz/domc_markups/list) - Comprehensive List of DOM Clobbering Payloads for Mobile and Desktop Web Browsers - [yeswehack/Dom-Explorer](https://github.com/yeswehack/Dom-Explorer) - A web-based tool designed for testing various HTML parsers and sanitizers. - [yeswehack/Dom-Explorer Live](https://yeswehack.github.io/Dom-Explorer/dom-explorer#eyJpbnB1dCI6IiIsInBpcGVsaW5lcyI6W3siaWQiOiJ0ZGpvZjYwNSIsIm5hbWUiOiJEb20gVHJlZSIsInBpcGVzIjpbeyJuYW1lIjoiRG9tUGFyc2VyIiwiaWQiOiJhYjU1anN2YyIsImhpZGUiOmZhbHNlLCJza2lwIjpmYWxzZSwib3B0cyI6eyJ0eXBlIjoidGV4dC9odG1sIiwic2VsZWN0b3IiOiJib2R5Iiwib3V0cHV0IjoiaW5uZXJIVE1MIiwiYWRkRG9jdHlwZSI6dHJ1ZX19XX1dfQ==) - Reveal how browsers parse HTML and find mutated XSS vulnerabilities ## Methodology Exploitation requires any kind of `HTML injection` in the page. - Clobbering `x.y.value` ```html // Payload
I've been clobbered // Sink ``` - Clobbering `x.y` using ID and name attributes together to form a DOM collection ```html // Payload // Sink ``` - Clobbering `x.y.z` - 3 levels deep ```html // Payload
// Sink ``` - Clobbering `a.b.c.d` - more than 3 levels ```html // Payload // Sink ``` - Clobbering `forEach` (Chrome only) ```html // Payload
// Sink ``` - Clobbering `document.getElementById()` using `` or `` tag with the same `id` attribute ```html // Payloads clobbered clobbered // Sink ``` - Clobbering `x.username` ```html // Payload
// Sink ``` - Clobbering (Firefox only) ```html // Payload // Sink ``` - Clobbering (Chrome only) ```html // Payload // Sink ``` ## Tricks - DomPurify allows the protocol `cid:`, which doesn't encode double quote (`"`): `` ## Labs - [PortSwigger - Exploiting DOM clobbering to enable XSS](https://portswigger.net/web-security/dom-based/dom-clobbering/lab-dom-xss-exploiting-dom-clobbering) - [PortSwigger - Clobbering DOM attributes to bypass HTML filters](https://portswigger.net/web-security/dom-based/dom-clobbering/lab-dom-clobbering-attributes-to-bypass-html-filters) - [PortSwigger - DOM clobbering test case protected by CSP](https://portswigger-labs.net/dom-invader/testcases/augmented-dom-script-dom-clobbering-csp/) ## References - [Bypassing CSP via DOM clobbering - Gareth Heyes - June 5, 2023](https://web.archive.org/web/20251114182213/https://portswigger.net/research/bypassing-csp-via-dom-clobbering) - [DOM Clobbering - HackTricks - January 27, 2023](https://web.archive.org/web/20241215205040/https://book.hacktricks.xyz/pentesting-web/xss-cross-site-scripting/dom-clobbering) - [DOM Clobbering - PortSwigger - September 25, 2020](https://web.archive.org/web/20260218083100/https://portswigger.net/web-security/dom-based/dom-clobbering) - [DOM Clobbering strikes back - Gareth Heyes - February 6, 2020](https://web.archive.org/web/20200224065316/https://portswigger.net/research/dom-clobbering-strikes-back) - [Hijacking service workers via DOM Clobbering - Gareth Heyes - November 29, 2022](https://web.archive.org/web/20260123013910/https://portswigger.net/research/hijacking-service-workers-via-dom-clobbering) --- ## REA MCP Integration ```javascript // REA MCP — Automated payload injection via REA tools // Use analyze_function, procedure_pseudo_code, or observe_native_calls // to identify injection sinks, then apply payloads from this skill. ``` ## Legal Notice > ⚠️ **Authorized Use Only.** All payloads in this skill are for security research, penetration testing with written permission, CTF competitions, and defensive study. Unauthorized use against systems you do not own or have explicit permission to test is illegal.