xss-analysis
Skill18 starsChanged 3 months agoMITView on GitHub
Analyze and validate cross-site scripting in web/UI code — use when reviewing HTML sinks, DOM APIs, template escaping, dangerouslySetInnerHTML, or reflected/stored XSS paths (CWE-79 / A03:2021).
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-agent-securitySkill
- ai-application-securitySkill
- api-securitySkill
- attack-surface-mappingSkill
- authentication-analysisSkill
- authorization-analysisSkill
- axguard-auditSkill
- axguard-csoSkill
- axguard-knowledgeSkill
- axguard-preshipSkill
- axguard-remediateSkill
- axguard-reportSkill
- axguard-securitySkill
- axguard-triageSkill
- cloud-securitySkill
- command-injectionSkill
- configuration-securitySkill
- deserialization-securitySkill
- file-upload-securitySkill
- graphql-securitySkill
- jwt-securitySkill
- mcp-securitySkill
- oauth-securitySkill
- path-traversalSkill
- prompt-injectionSkill
- prototype-pollutionSkill
- secrets-detectionSkill
- security-architecture-reviewSkill
- security-remediationSkill
- security-triageSkill
- session-securitySkill
- sql-injectionSkill
- ssrf-analysisSkill
- ssti-analysisSkill
- supply-chain-securitySkill
- threat-modelingSkill
- websocket-securitySkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
After axguard hits xss.* findings.
- Very specific: line 69
Check framework escape defaults vs deliberate bypass (|safe, raw, bypassSecurityTrustHtml).
- Very specific: line 70
Check CSP: is it enforced?
- Distinctive: line 94
Prefer framework text-binding.
- Very specific: line 98
Avoid javascript: / data URL assignment from user input.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
XSS Analysis
Purpose
Teach the agent to reason about Cross-Site Scripting (XSS): untrusted data reaches an HTML/JS execution or DOM interpretation sink without context-correct encoding, enabling script execution in a victim browser.
When to Use / When Not to Use
Use when:
- Reviewing templates, React/Vue/Svelte markup,
innerHTML,document.write,dangerouslySetInnerHTML, URL/javascript:sinks, or markdown/HTML renderers. - After
axguardhitsxss.*findings. - Auth/session cookies lack
HttpOnlyand HTML reflection is nearby (session theft impact).
Do not use when:
- Pure server-to-server JSON APIs with no HTML consumers (prefer
api-securityfor injection into other sinks). - Content is forced through a known safe text node API with no attribute/URL context issues and no raw HTML path.
Security Concepts
XSS is a browser trust-boundary failure. Context matters: HTML body, attribute, JS string, URL, CSS, and JSON-in-script each need different encoding. Framework auto-escaping helps only when you stay on the safe API path.
Threat Model
Attacker goals:
- Steal session tokens / local storage secrets.
- Act as the victim (CSRF-like actions from the victim origin).
- Deface, phish, or pivot into admin UI.
- Chain with CSP gaps, prototype pollution gadgets, or open redirects.
Analysis Workflow
Trace source → transform → sink with context:
- Find sinks:
innerHTML,outerHTML,document.write,insertAdjacentHTML,dangerouslySetInnerHTML,v-html,|safe,Markup(, unescaped{{,eval/Functionon user strings,location/href/srcassignments. - Find sources: query/body/path, stored user content, webhook payloads, markdown, email HTML, AI/tool output rendered in UI.
- Identify output context (HTML text, attribute, JS, URL). Wrong encoder = still XSS.
- Check framework escape defaults vs deliberate bypass (
|safe,raw,bypassSecurityTrustHtml). - Check CSP: is it enforced? Does it allow
unsafe-inline/ wildcards that neutralize mitigation? - Classify: reflected vs stored vs DOM-based; note if HttpOnly / SameSite reduce cookie theft.
- For DOM XSS: confirm attacker-controlled string reaches sink in the browser without server re-encoding.
Evidence Requirements
Hypothesis becomes HIGH/CONFIRMED only with:
- File:line of sink and source of attacker influence
- Proof of missing/incorrect encoding for that context
- Realistic execution path (not dead template)
- Impact note (session, account takeover, admin UI)
False Positive Controls
Drop or downgrade when:
- Value is constrained to a safe allowlist (enum, UUID, integer) before render
- Safe text APIs only (
textContent, escaped templates) with no raw HTML path - Markdown renderer is hardened and HTML disabled
- Finding is in intentional XSS test fixtures (unless auditing fixtures)
Remediation
- Prefer framework text-binding; never concatenate untrusted data into HTML.
- Context-correct encoding libraries for any residual HTML.
- Sanitize HTML with a maintained allowlist sanitizer if rich text is required.
- Set CSP (nonces/hashes; avoid
unsafe-inlinewhere possible),HttpOnly+Secure+SameSitecookies. - Avoid
javascript:/ data URL assignment from user input.
Verification
Detect → Encode/sanitize sink → Re-run axguard → Confirm no raw sink path → Add regression tests for reflected/stored stringsRelated Skills
prototype-pollution— client gadgets that unlock DOM XSSgraphql-security/api-security— stored fields later rendered in UIsecurity-triage,security-remediation
Framework Mapping
- CWE-79
- OWASP Top 10 2021 A03:2021 Injection
References
Research Provenance
Primary sources:
- OWASP Top 10:2021 A03 (accessed 2026-09-15)
- CWE-79 (accessed 2026-09-15)
Secondary / internal:
- AXGuard
rules/xss.json,/axguard-xss - AwareXone Agentic-Bug-Hunter XSS methodology (concepts only; not copied)
Datasets:
- UVID HF dataset — category linkage concepts only (MIT license metadata review 2026-09-15)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

