xss-scan

xss-scan is a command for Claude Code from HermeticOrmus/LibreUIUX-Claude-Code. It costs 11 tokens per session (2,030 once invoked), scanned A, original, MIT.

A scanner for finding cross-site scripting, or XSS, risks in browser-side JavaScript and frontend frameworks. XSS happens when untrusted user input is treated as webpage code.

In plain words
What is it for?
Use it to inspect React, Vue, Angular, or plain JavaScript for unsafe DOM updates, URL handling, and missing sanitization.
Why use it?
Unsafe HTML insertion, links, or missing input cleanup can let attackers run code in another user's browser. It points out risky code and suggests fixes.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the frontend-mobile-security plugin — 1 command, 2 agents shipped together

Good fit Use it to inspect React, Vue, Angular, or plain JavaScript for unsafe DOM updates, URL handling, and missing sanitization.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hermeticormus/libreuiux-claude-code/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/HermeticOrmus/LibreUIUX-Claude-Code

Made for: Claude Code.

Or install frontend-mobile-security, the plugin that ships this one along with the rest of its 1 command, 2 agents.

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/hermeticormus/libreuiux-claude-code/xss-scan/github.svg)](https://agentmods.dev/commands/hermeticormus/libreuiux-claude-code/xss-scan)
Your own site
<a href="https://agentmods.dev/commands/hermeticormus/libreuiux-claude-code/xss-scan"><img src="https://agentmods.dev/badge/commands/hermeticormus/libreuiux-claude-code/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/hermeticormus/libreuiux-claude-code/xss-scan"><img src="https://agentmods.dev/badge/commands/hermeticormus/libreuiux-claude-code/xss-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,030 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.00011 $0.02030
Opus 5.5 $0.00004 $0.00812
Sonnet 5.5 $0.00002 $0.00406
Haiku 4.5 $0.00001 $0.00203

Measured 2mo ago against content hash d60454c5af3d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

  • xss-scan — 100% identical, 5 lines differ
  • xss-scan — 100% identical, 5 lines differ
plugins/frontend-mobile-security/commands/xss-scan.md · 313 lines

How it starts

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

XSS Vulnerability Scanner for Frontend Code

You are a frontend security specialist focusing on Cross-Site Scripting (XSS) vulnerability detection and prevention. Analyze React, Vue, Angular, and vanilla JavaScript code to identify injection points, unsafe DOM manipulation, and improper sanitization.

Context

The user needs comprehensive XSS vulnerability scanning for client-side code, identifying dangerous patterns like unsafe HTML manipulation, URL handling issues, and improper user input rendering. Focus on context-aware detection and framework-specific security patterns.

Requirements

$ARGUMENTS

Instructions

1. XSS Vulnerability Detection

Scan codebase for XSS vulnerabilities using static analysis:

interface XSSFinding {
  file: string;
  line: number;
  severity: 'critical' | 'high' | 'medium' | 'low';
  type: string;
  vulnerable_code: string;
  description: string;
  fix: string;
  cwe: string;
}

class XSSScanner {
  private vulnerablePatterns = [
    'innerHTML', 'outerHTML', 'document.write',
    'insertAdjacentHTML', 'location.href', 'window.open'
  ];

  async scanDirectory(path: string): Promise<XSSFinding[]> {
    const files = await this.findJavaScriptFiles(path);
    const findings: XSSFinding[] = [];

    for (const file of files) {
      const content = await fs.readFile(file, 'utf-8');
      findings.push(...this.scanFile(file, content));
    }

    return findings;
  }

  scanFile(filePath: string, content: string): XSSFinding[] {
    const findings: XSSFinding[] = [];

    findings.push(...this.detectHTMLManipulation(filePath, content));
    findings.push(...this.detectReactVulnerabilities(filePath, content));
    findings.push(...this.detectURLVulnerabilities(filePath, content));
    findings.push(...this.detectEventHandlerIssues(filePath, content));

    return findings;
  }

  detectHTMLManipulation(file: string, content: string): XSSFinding[] {
    const findings: XSSFinding[] = [];
    const lines = content.split('\n');

    lines.forEach((line, index) => {
      if (line.includes('innerHTML') && this.hasUserInput(line)) {
        findings.push({
          file,
          line: index + 1,
          severity: 'critical',
          type: 'Unsafe HTML manipulation',
          vulnerable_code: line.trim(),
          description: 'User-controlled data in HTML manipulation creates XSS risk',
          fix: 'Use textContent for plain text or sanitize with DOMPurify library',
          cwe: 'CWE-79'
        });
      }
    });

    return findings;
  }

  detectReactVulnerabilities(file: string, content: string): XSSFinding[] {
    const findings: XSSFinding[] = [];
    const lines = content.split('\n');

    lines.forEach((line, index) => {
      if (line.includes('dangerously') && !this.hasSanitization(content)) {
        findings.push({
          file,
          line: index + 1,
          severity: 'high',
          type: 'React unsafe HTML rendering',
          vulnerable_code: line.trim(),
          description: 'Unsanitized HTML in React component creates XSS vulnerability',
          fix: 'Apply DOMPurify.sanitize() before rendering or use safe alternatives',
          cwe: 'CWE-79'
        });
      }
    });

    return findings;
  }

  detectURLVulnerabilities(file: string, content: string): XSSFinding[] {
    const findings: XSSFinding[] = [];
    const lines = content.split('\n');

    lines.forEach((line, index) => {
      if (line.includes('location.') && this.hasUserInput(line)) {
        findings.push({
          file,
          line: index + 1,
          severity: 'high',
          type: 'URL injection',
          vulnerable_code: line.trim(),
          description: 'User input in URL assignment can execute malicious code',
          fix: 'Validate URLs and enforce http/https protocols only',
          cwe: 'CWE-79'
        });
      }
    });

    return findings;
  }

  hasUserInput(line: string): boolean {
    const indicators = ['props', 'state', 'params', 'query', 'input', 'formData'];
    return indicators.some(indicator => line.includes(indicator));
  }

  hasSanitization(content: string): boolean {
    return content.includes('DOMPurify') || content.includes('sanitize');
  }
}

Read the full file on GitHub · 313 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. 2mo ago Changed · +5 lines · +11 tokens per session d60454c5af3d
  2. 2mo ago First seen · 308 lines · 0 tokens per session scan A 07e4a19b7a4d

Subscribe to this mod's changes

xss-scan is a command published in the GitHub repository HermeticOrmus/LibreUIUX-Claude-Code (115 stars, last pushed 1mo ago), licensed MIT. It adds 11 tokens to every session and 2,030 once invoked, about $0.0000 per session on Opus 5.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.

Related

xss-scan compared with commands from other repositories

xss-scan next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
xss-scanHermeticOrmus/LibreUIUX-Claude-CodeCommand1151mo agoMITA11Claude Code
growth-landingchristopherlouet/claude-baseCommand5yesterdayMITA0Claude Code
sheleg-designssheleg/sheleg-design-skillCommand4yesterdayMITA16Claude Code
p3-ux-darkmodejonase47/ccprCommand12mo agoMITA0Claude Code
rust:tauri:exec-jsqdhenry/Claude-Command-SuiteCommand1.4k9mo agononeA21Claude Code
ccc-multi-frontendKevinZai/commanderCommand6todayMITA39Claude Code
checklistgithub/spec-kitCommand153kyesterdayMITA13Claude Code