frontend-mobile-security-xss-scan

Detect XSS vulnerabilities in React, Vue, Angular, and vanilla JavaScript code.

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/MaiconGambini/opencode-harness-guide --skill frontend-mobile-security-xss-scan-maicongambini
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-mobile-security-xss-scan
Source: https://github.com/MaiconGambini/opencode-harness-guide/tree/main/skills/frontend-mobile-security-xss-scan
Command: npx skills add https://github.com/MaiconGambini/opencode-harness-guide --skill frontend-mobile-security-xss-scan-maicongambini

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Cross-Site Scripting (XSS) vulnerabilities hide in everyday frontend patterns like innerHTML assignments, React's dangerouslySetInnerHTML, and Vue's v-html directive, and manual code review often misses them. This Skill scans client-side code for unsafe DOM manipulation, URL injection, and unsanitized rendering, then reports each finding with severity, CWE reference, and a concrete fix. ## Core Features & Use Cases - Static XSS Detection: Scans JavaScript and TypeScript files for dangerous patterns such as innerHTML, document.write, insertAdjacentHTML, and unsafe location.href assignments involving user-controlled data. - Framework-Specific Analysis: Detects React's dangerouslySetInnerHTML without DOMPurify sanitization and Vue's v-html directive, with guidance for Angular's built-in sanitization. - Actionable Reports: Groups findings by severity (critical, high, medium, low) with file, line number, vulnerable code, fix recommendation, and CWE-79 mapping. - Use Case: Before shipping a React feature that renders user-submitted comments, run the scan to catch any unsanitized dangerouslySetInnerHTML usage and receive the exact DOMPurify.sanitize() pattern to apply. ## Quick Start Scan the src directory of my React project for XSS vulnerabilities and generate a severity-grouped report with fix recommendations.

Frequently Asked Questions about frontend-mobile-security-xss-scan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scan JavaScript code for XSS vulnerabilities?

Run static analysis that flags dangerous patterns like innerHTML, outerHTML, document.write, and insertAdjacentHTML when combined with user-controlled input such as props, state, or query parameters. Each finding includes the file, line, severity, and a fix recommendation.

How to fix dangerouslySetInnerHTML XSS in React?

Sanitize the HTML with DOMPurify before rendering: pass DOMPurify.sanitize(html) as the __html value. If only plain text is needed, avoid dangerouslySetInnerHTML entirely and let React escape content by default.

Is Vue v-html safe to use with user input?

No, v-html renders raw HTML and creates an XSS risk when bound to user-controlled data. Use v-text for plain text, or sanitize the HTML with a library like DOMPurify before binding it to v-html.

Can ESLint or Semgrep detect XSS vulnerabilities?

Yes, eslint-plugin-security flags common unsafe patterns, and Semgrep's p/xss ruleset detects XSS sinks across a codebase. These complement manual pattern scanning for innerHTML and URL injection issues.

What are the limitations of static XSS scanning?

Static pattern matching cannot trace data flow across modules or confirm exploitability at runtime, so it may produce false positives and miss obfuscated sinks. Combine it with dynamic testing and manual review for complete coverage.