sast-analysis
Perform codebase analysis and architecture mapping as the first phase of a security assessment. Explores the tech stack,…
Detect Cross-Site Scripting (XSS) vulnerabilities in a codebase using a three-phase approach: recon (find HTML/JS/DOM sink sites), batched verify (trace user input to sinks in parallel subagents, 3 sink sites each), and merge (consolidate batch results). Requires
Claude Code
$ npx -y skills add utkusen/sast-skills --skill sast-xss --agent claude-code
Codex
$ npx skills add utkusen/sast-skills --skill sast-xss -a codex -y
Cursor
$ npx skills add utkusen/sast-skills --skill sast-xss -a cursor -y
Gemini CLI
$ npx skills add utkusen/sast-skills --skill sast-xss -a gemini-cli -y
GitHub Copilot
$ npx skills add utkusen/sast-skills --skill sast-xss -a github-copilot -y
OpenCode
$ npx skills add utkusen/sast-skills --skill sast-xss -a opencode -y
Windsurf
$ npx skills add utkusen/sast-skills --skill sast-xss -a windsurf -y
name: sast-xss description: >- Detect Cross-Site Scripting (XSS) vulnerabilities in a codebase using a three-phase approach: recon (find HTML/JS/DOM sink sites), batched verify (trace user input to sinks in parallel subagents, 3 sink sites each), and merge (consolidate batch results). Requires sast/architecture.md (run sast-analysis first). Outputs findings to sast/xss-results.md. Use when asked to find XSS or cross-site scripting bugs.
You are performing a focused security assessment to find Cross-Site Scripting vulnerabilities in a codebase. This skill uses a three-phase approach with subagents: **recon** (find sink sites), **batched verify** (trace taint for parallel batches of up to 3 sinks each), and **merge** (consolidate batch results into one report).
**Prerequisites**: `sast/architecture.md` must exist. Run the analysis skill first if it doesn't.
---
XSS occurs when user-supplied input is incorporated into a web page's HTML, JavaScript, or DOM without proper escaping or sanitization. This allows attackers to inject and execute arbitrary scripts in victims' browsers, leading to session hijacking, credential theft, defacement, and malware distribution.
The core pattern: *unescaped, unsanitized user input reaches an HTML/JS output sink.*
**Server-side HTML sinks** — rendering user data into HTML responses without escaping:
**Client-side DOM sinks** — JavaScript writing user-controlled data to the DOM unsafely:
**JavaScript execution sinks** — user-controlled data evaluated as code:
**DOM-based sources** — attacker-controlled inputs read by client-side JavaScript:
Do not flag these as XSS:
When you see these patterns, the code is likely **not vulnerable**:
**1. Context-aware auto-escaping (most template engines default)**
# Jinja2 / Django (auto-escape on by default)
{{ var }} # HTML-escaped → safe
# EJS
<%= var %> # HTML-escaped → safe
# Handlebars
{{ var }} # HTML-escaped → safe
# Pug
= var # HTML-escaped → safe
# Thymeleaf
th:text="${var}" # HTML-escaped → safe
# Razor (C#)
@var # HTML-encoded → safe**2. Explicit escaping before output**
// PHP echo htmlspecialchars($var, ENT_QUOTES, 'UTF-8');
# Rails <%= h(var) %> <%= ERB::Util.html_escape(var) %>
// JSP with JSTL
<c:out value="${var}"/>
// or fn:escapeXml()
${fn:escapeXml(var)}A collection of agent skills that turn your LLM coding assistant into a fully functional SAST scanner to find vulnerabilities in your codebase. Works natively with Claude Code, Codex, Opencode, Cursor and any other assistant that supports agent skills.
Perform codebase analysis and architecture mapping as the first phase of a security assessment. Explores the tech stack,…
Detect business logic vulnerabilities in a codebase using a three-phase approach: threat modeling (domain analysis and attack…
Detect insecure file upload vulnerabilities in a codebase using a three-phase approach: discovery (find all upload sites),…
Detect GraphQL injection vulnerabilities in a codebase using a three-phase approach: recon (confirm GraphQL usage and find unsafe…
Detect hardcoded sensitive data (API keys, access tokens, private keys, passwords, etc.) in publicly accessible code — frontend…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…