Cross-Site Scripting testing — reflected, stored, DOM-based, blind and mutation XSS across HTML, attribute, JavaScript, URI, CSS and framework contexts. Context-aware payload selection, WAF/filter-evasion and CSP-bypass techniques, dynamic payload generation, and impact escalation. Use for any user-controllable output in a web app or bug-bounty target.
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 Web Xss?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-web-xss)
---
name: web-xss
description: Cross-Site Scripting testing — reflected, stored, DOM-based, blind and mutation XSS across HTML, attribute, JavaScript, URI, CSS and framework contexts. Context-aware payload selection, WAF/filter-evasion and CSP-bypass techniques, dynamic payload generation, and impact escalation. Use for any user-controllable output in a web app or bug-bounty target.
---
# Cross-Site Scripting (XSS)
XSS is a context problem, not a payload problem. The job is to (1) find where input reaches output, (2) identify the exact output context, (3) craft a payload that breaks out of that context, (4) defeat any filtering/CSP, and (5) escalate impact. Do not fire random payloads — read the reflection, then choose.
## Trigger phrases
`xss, cross-site scripting, reflected xss, stored xss, dom xss, blind xss, csp bypass, html injection, mutation xss, mxss, dom clobbering, javascript injection`
## Workflow (Recon → Context → Break-out → Evade → Escalate)
### 1. Find input→output flows
- Reflect a unique canary (`zq9X7k`) into every parameter, header (Referer, User-Agent, X-Forwarded-For), path segment, cookie, JSON field, and filename. Grep responses for the canary.
- For stored XSS, submit the canary through every write path (profile, comments, uploads, support tickets, admin-visible logs) and look for it rendering in any viewer, including admin panels (→ blind XSS).
- For DOM XSS, trace sources → sinks in client JS (see §DOM).
### 2. Identify the context
Where does the canary land? This dictates the break-out:
| Context | Example | Break-out needed |
|---|---|---|
| HTML body | `<div>CANARY</div>` | inject a tag/event |
| Tag attribute (quoted) | `value="CANARY"` | close quote + attribute/event |
| Tag attribute (unquoted) | `value=CANARY` | space + event handler |
| Inside `<script>` | `var x='CANARY'` | close string/script, or use template |
| URL/href/src | `href="CANARY"` | `javascript:` URI |
| CSS/style | `style="CANARY"` | expression/`url()` |
| Framework interpolation | `{{CANARY}}` | template/CSTI (→ `web-ssti` for server-side) |
Note what characters survive (`<`, `>`, `"`, `'`, `/`, `` ` ``, `=`, `(`). The surviving set drives payload choice and encoding.
### 3. Break out (context payloads)
Draw from `${CLAUDE_PLUGIN_ROOT}/payloads/xss.md`. Core by context:
- **HTML body:** `<svg onload=alert(1)>` · `<img src=x onerror=alert(1)>` · `<details open ontoggle=alert(1)>`
- **Quoted attribute:** `"><svg onload=alert(1)>` · `" autofocus onfocus=alert(1) x="`
- **Unquoted attribute:** `x onmouseover=alert(1) ` · `x autofocus onfocus=alert(1)`
- **Inside JS string:** `';alert(1);//` · `</script><svg onload=alert(1)>` · `'-alert(1)-'`
- **href/URL:** `javascript:alert(1)` · `javascript:alert(document.domain)`
- **Polyglot (context-agnostic probe):** `jaVasCript:/*-/*`/*\`/*'/*"/**/(/* */oNcliCk=alert() )//%0D%0A%0d%0a//</stYle/</titLe/</teXtarEa/</scRipt/--!>\x3csVg/<sVg/oNloAd=alert()//>\x3e`
### 4. Evade filters & WAF
When payloads are blocked, mutate rather than repeat (see `${CLAUDE_PLUGIN_ROOT}/payloads/xss.md` → Evasion):
- **Case/spacing:** `<ScRiPt>`, tab/newline/FF between attributes, `<svg/onload=...>`.
- **Encoding:** HTML entities (`a`), URL/double-URL, unicode escapes in JS (`a`), base64 via `atob`, overlong UTF-8.
- **Tag/handler variety:** when `script`/`onerror` are filtered, rotate through the large event-handler and tag lists (`onpointerenter`, `onanimationstart`, `onbeforetoggle`, `<marquee>`, `<body>`, `<form>`).
- **No-parentheses / no-alert:** `onerror=alert` + throw, backtick calls `` alert`1` ``, `setTimeout('alert(1)')`, `location=name`, template-string exec.
- **Sanitizer bypass (DOMPurify/mXSS):** nesting/namespace confusion (`<svg><style>`, `<math>`, `<noscript>`), mutation gadgets — track the exact sanitizer version against known bypasses.
### 5. Defeat CSP
- Inspect the `Content-Security-Policy` header. Look for: `unsafe-inline`, `unsafe-eval`, wildcard/overly-broad sources, `data:`/`blob:` allowed, missing `object-src`/`base-uri`, nonce reuse, JSONP endpoints or Angular/other libraries on an allowlisted host (gadget), open redirects on allowed origins.
- Exploit paths: JSONP callback injection, AngularJS CSTI on allowlisted CDN, `base-uri` hijack, dangling-markup data exfiltration when script is blocked.
### 6. Escalate impact (do not stop at `alert(1)`)
Convert PoC into real impact matched to the app:
- Session/cookie theft (if not HttpOnly), token theft from storage, CSRF-token exfiltration to chain state-changing actions.
- Account takeover: change email/password, add OAuth/MFA, read reset tokens.
- Admin-targeted stored/blind XSS → privileged actions; keylogging on login forms; BeEF-style hooking for pivoting.
- Report the *maximum demonstrable* impact for the user population affected.
## DOM XSS specifics
- **Sources:** `location.*`, `document.URL`, `referrer`, `window.name`, `postMessage`, storage, `document.cookie`.
- **Sinks:** `innerHTML`/`outerHTML`, `document.write`, `eval`, `setTimeout`/`Function`, `location`/`.href`, jQuery `$()`/`.html()`, framework sinks (`dangerouslySetInnerHTML`, `v-html`, Angular bypass APIs).
- Method: dynamic taint analysis in DevTools / headless browser — set a source, watch it reach a sink. Test hash and query sources; many DOM XSS need no server round-trip.
## Blind XSS
- Inject into fields rendered later in places you can't see (admin dashboards, log viewers, support tools, PDF/report generators, email). Use an out-of-band callback payload (XSS Hunter-style) that beacons origin, cookies, DOM, and screenshot. Tag each injection point so you know which fired.
## Framework notes
- **React:** JSX auto-escapes; bugs live in `dangerouslySetInnerHTML`, `href={userInput}` (`javascript:`), `ref` tricks, server-rendered injection.
- **Vue:** `v-html`, template compilation on user data (CSTI).
- **Angular:** `bypassSecurityTrust*`, template injection on allowlisted versions.
## Evidence & verification
Capture the firing payload, the rendered response/DOM, and a screenshot/GIF of execution. Confirm in a real browser context. Record parameter, context, and the evasion chain used.
See `${CLAUDE_PLUGIN_ROOT}/payloads/xss.md` for the full payload and evasion library.