xss-scan

xss-scan is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 46 tokens per session (867 once invoked), scanned A, original, MIT.

A scanner for Angular applications that looks for patterns linked to cross-site scripting, or XSS, attacks. XSS is a security flaw where untrusted content can run code in a user’s browser.

In plain words
What is it for?
Use it to scan TypeScript and HTML files for risky Angular patterns and receive severity-based findings with DOMPurify remediation examples.
Why use it?
It highlights unsafe HTML and URL handling, direct DOM changes, and sanitizer bypasses that can expose an application to injected content.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to scan TypeScript and HTML files for risky Angular patterns and receive severity-based findings with DOMPurify remediation examples.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kumaran-is/claude-code-onboarding/xss-scan
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/kumaran-is/claude-code-onboarding

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for xss-scan

README.md
[![agentmods](https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/xss-scan/github.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/xss-scan)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/xss-scan"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/xss-scan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for xss-scan

Your own site · 80×15
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/xss-scan"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/xss-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 867 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.00867
Opus 5 $0.00023 $0.00434
Sonnet 5 $0.00009 $0.00173
Haiku 4.5 $0.00005 $0.00087

Measured 5d ago against content hash 667a05f9eee5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

xss-scan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/xss-scan.md · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Angular XSS Vulnerability Scan

Target path: $ARGUMENTS (default: src/).

Step 1: Scan for dangerous patterns

Run grep searches for each severity category against *.ts and *.html files in the target path.

CRITICAL

# Script injection bypass
grep -rnE 'bypassSecurityTrustScript\(' $ARGUMENTS --include='*.ts'
# URL injection bypass (may enable javascript: URIs)
grep -rnE 'bypassSecurityTrustUrl\(' $ARGUMENTS --include='*.ts'

HIGH

# HTML injection bypass
grep -rnE 'bypassSecurityTrustHtml\(' $ARGUMENTS --include='*.ts'
# Direct DOM manipulation bypassing Angular sanitizer
grep -rnE 'ElementRef.*nativeElement.*innerHTML' $ARGUMENTS --include='*.ts'
# Direct innerHTML assignment in component code
grep -rnE 'document\..*\.innerHTML\s*=' $ARGUMENTS --include='*.ts'
# Template innerHTML binding
grep -rnE '\[innerHTML\]=' $ARGUMENTS --include='*.html'

MEDIUM

# nativeElement innerHTML in any context
grep -rnE 'nativeElement\.innerHTML' $ARGUMENTS --include='*.ts'
# bypassSecurityTrustResourceUrl (less severe but still risky)
grep -rnE 'bypassSecurityTrustResourceUrl\(' $ARGUMENTS --include='*.ts'

Step 2: Report each finding

For every match, output in this format:

SEVERITY: [CRITICAL/HIGH/MEDIUM]
File: [path:line]
Pattern: [the detected code snippet]
Risk: XSS via unsanitized user input reaching DOM
Fix: [specific Angular-idiomatic fix from the table below]

Secure alternatives

Vulnerable Pattern Fix
bypassSecurityTrustHtml(val) Call DomSanitizer.sanitize(SecurityContext.HTML, val) first, then bypass only if needed
[innerHTML]="var" Use [textContent]="var" for plain text; for HTML, pipe through DomSanitizer
nativeElement.innerHTML = x Use Renderer2.setProperty(el, 'innerHTML', sanitized) instead
bypassSecurityTrustScript(x) Remove entirely -- load scripts via Angular-approved methods only
bypassSecurityTrustUrl(x) Validate URL scheme is http:/https: before bypass; reject javascript:
Any HTML rendering Add DOMPurify.sanitize(input) as secondary defense before rendering

Read the full file on GitHub · 94 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 94 lines · 46 tokens per session scan A 667a05f9eee5

Subscribe to this mod's changes

xss-scan is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 46 tokens to every session and 867 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.