DOM clobbering — injecting named HTML elements (id/name) that overwrite JavaScript variables/globals to bypass client-side logic or reach a sink, used when HTML injection is possible but script is sanitized. Tier 1. Payloads: payloads/client-side.md. Use when you can inject sanitized HTML (allowed tags/attributes) but not script.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Dom Clobbering?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-dom-clobbering)
---
name: dom-clobbering
description: "DOM clobbering — injecting named HTML elements (id/name) that overwrite JavaScript variables/globals to bypass client-side logic or reach a sink, used when HTML injection is possible but script is sanitized. Tier 1. Payloads: payloads/client-side.md. Use when you can inject sanitized HTML (allowed tags/attributes) but not script."
---
# DOM Clobbering
When markup injects but script is filtered, named elements can clobber JS globals to subvert client logic.
## Trigger phrases
`dom clobbering, clobber variable, named element injection, sanitized html bypass`
## Method
1. Confirm you can inject HTML with `id`/`name` attributes (sanitizer allows anchors/forms/images).
2. Clobber a global the app reads: `<a id=x>`, `<a id=x name=y>`, `<form name=config><input name=url value="//attacker"></form>`, `<img name=getElementById>` (clobber a function), nested `id`/`name` for property chains (`config.url`).
3. Drive the clobbered value into a sink (script src, config, redirect) → XSS (→ `dom-xss`) or logic/auth bypass.
4. **Modern:** `document.currentScript` clobbering in bundler shims; two-element property-chain clobbering.
## Escalation
DOM XSS or bypass of a client-side security check when full XSS is blocked by CSP/sanitizer.
## Backend & tooling
Preferred Kali path or headless browser for client-side execution/evidence; if a Burp MCP is present, proxy traffic for visibility and send PoCs to Repeater (see `zazy-orchestrator`).
## Verification (background, before reporting)
Reproduce in a real browser / second context and confirm impact before marking CONFIRMED; use OAST for blind cases. Report true positives only.
## Evidence
The injected named elements, the clobbered variable, and the resulting sink/bypass.