| name | frontend-mobile-security-xss-scan |
| description | 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 poi |
| type | skill |
| created | 2026-02-27T00:00:00.000Z |
| domain | security |
| category | app-security |
| risk | unknown |
| source | community |
| tags | ["skill","security","app-security","frontend","mobile"] |
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.
Use this skill when
- Working on xss vulnerability scanner for frontend code tasks or workflows
- Needing guidance, best practices, or checklists for xss vulnerability scanner for frontend code
Do not use this skill when
- The task is unrelated to xss vulnerability scanner for frontend code
- You need a different domain or tool outside this scope
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'
];
(: ): <[]> {
files = .(path);
: [] = [];
( file files) {
content = fs.(file, );
findings.(....(file, content));
}
findings;
}
(: , : ): [] {
: [] = [];
findings.(....(filePath, content));
findings.(....(filePath, content));
findings.(....(filePath, content));
findings.(....(filePath, content));
findings;
}
(: , : ): [] {
: [] = [];
lines = content.();
lines.( {
(line.() && .(line)) {
findings.({
file,
: index + ,
: ,
: ,
: line.(),
: ,
: ,
:
});
}
});
findings;
}
(: , : ): [] {
: [] = [];
lines = content.();
lines.( {
(line.() && !.(content)) {
findings.({
file,
: index + ,
: ,
: ,
: line.(),
: ,
: ,
:
});
}
});
findings;
}
(: , : ): [] {
: [] = [];
lines = content.();
lines.( {
(line.() && .(line)) {
findings.({
file,
: index + ,
: ,
: ,
: line.(),
: ,
: ,
:
});
}
});
findings;
}
(: ): {
indicators = [, , , , , ];
indicators.( line.(indicator));
}
(: ): {
content.() || content.();
}
}