Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
IMPORTANT: This skill performs client-side security analysis on the user's own codebase. This is defensive security testing to find browser-side vulnerabilities.
Authorization: The user owns this codebase and has explicitly requested this specialized analysis.
Multi-Framework Support
Framework
Versions
Special Considerations
React
16+, 18+, 19+
RSC, Server Actions, JSX injection
Next.js
12+, 13+, 14+, 15+
App Router, Server Components, Middleware
Vue
2, 3
v-html, template injection
Angular
12+
bypassSecurityTrust*, template injection
Svelte
3, 4, 5
{@html}, SSR
SolidJS
1.x
innerHTML, SSR
Vanilla JS
ES6+
Direct DOM manipulation
jQuery
All
.html(), .append()
Overview
This specialist skill performs deep client-side JavaScript security analysis, focusing on vulnerabilities in modern frameworks including React, Vue, Angular, and SSR frameworks.
When to Use: After /scan identifies significant client-side JavaScript, SPAs, or SSR applications.
Goal: Find DOM-based XSS, prototype pollution, and framework-specific vulnerabilities.
Engagement Mode Compatibility
Mode
Specialist Behavior
PRODUCTION_SAFE
Code-level and rendering-path analysis, minimal runtime probes
STAGING_ACTIVE
Controlled browser-side verification with throttling
LAB_FULL
Expanded dynamic client attack-surface validation
LAB_RED_TEAM
End-to-end client attack-chain simulation in isolated lab
Safety Gates (Required)
Read deliverables/engagement_profile.md before active runtime testing.
Default to PRODUCTION_SAFE when mode is not specified.
Enforce kill-switch thresholds and stop on instability.
Never execute persistent or user-impacting payloads in production.
Client-Side Risks Covered
Risk
Description
Impact
DOM XSS
Client-side script injection
Account takeover, data theft
React XSS
Unsafe HTML rendering, href injection
XSS via JSX
SSR Injection
Server component injection
RCE, data leak
Prototype Pollution
Object prototype manipulation
XSS, DoS, logic bypass
PostMessage Abuse
Cross-origin message issues
Data leakage, XSS
DOM Clobbering
HTML overwriting JS variables
XSS, security bypass
Client Storage
Sensitive data exposure
Session hijacking
Execution Instructions
Step 0: Mode & Scope Alignment
Load mode/scope/limits from deliverables/engagement_profile.md.
Respect deliverables/verification_scope.md when present.
In PRODUCTION_SAFE, prefer static and minimal observable checks only.
"Analyze Next.js App Router and Server Components for security issues."
Patterns:
// VULNERABLE - SQL in Server ComponentasyncfunctionUserPage({ params }) {
const user = await db.query(`SELECT * FROM users WHERE id = ${params.id}`);
return<div>{user.name}</div>;
}
// VULNERABLE - Exposing secrets to client// In Server Component that passes to Client Component
<ClientComponent apiKey={process.env.SECRET_KEY} />
// VULNERABLE - Unvalidated redirectimport { redirect } from'next/navigation';
redirect(userInput);
Next.js Server Actions Analyst:
"Analyze Server Actions for security issues."
Patterns:
// VULNERABLE - No auth check in Server Action'use server'asyncfunctiondeleteUser(userId: string) {
await db.users.delete(userId); // No auth check!
}
// VULNERABLE - SQL injection in Server Action'use server'asyncfunctionsearchUsers(query: string) {
return db.query(`SELECT * FROM users WHERE name LIKE '%${query}%'`);
}
// VULNERABLE - CSRF (if custom implementation)// Server Actions have built-in CSRF protection, but check custom forms
Next.js Middleware Analyst:
"Analyze Next.js middleware for security issues."
Patterns:
// VULNERABLE - Open redirectexportfunctionmiddleware(request: NextRequest) {
const url = request.nextUrl.searchParams.get('redirect');
returnNextResponse.redirect(url); // No validation!
}
// VULNERABLE - Auth bypass via header manipulationexportfunctionmiddleware(request: NextRequest) {
if (request.headers.get('x-admin') === 'true') {
returnNextResponse.next(); // Spoofable!
}
}
React State Exposure Analyst:
"Check for sensitive data exposure in React state/props."
Patterns:
// VULNERABLE - Secrets in client stateconst [config, setConfig] = useState({
apiKey: 'sk-xxx', // Exposed in React DevToolsadminToken: '...'
});
// VULNERABLE - SSR hydration mismatch leaking data// Server renders with user data, client sees different user's data
// VULNERABLE - Deep merge without __proto__ checkfunctionmerge(target, source) {
for (let key in source) {
if (typeof source[key] === 'object') {
target[key] = merge(target[key] || {}, source[key]);
} else {
target[key] = source[key]; // Can set __proto__
}
}
}
// VULNERABLE - URL params to objectconst params = Object.fromEntries(newURLSearchParams(location.search));
// Attack: ?__proto__[isAdmin]=true// VULNERABLE libraries (check versions)// lodash < 4.17.12// jQuery < 3.4.0// minimist < 1.2.3
Gadget Finder Agent:
"Find prototype pollution gadgets."
Patterns:
// GADGET - Property access on polluted prototypeif (options.isAdmin) { // Can be pollutedshowAdminPanel();
}
// GADGET - HTML attribute setting
element.setAttribute(key, config[key]); // key from polluted proto
Library Analyst:
"Check for vulnerable libraries."
Phase 6: PostMessage Analysis (2 Parallel Agents)
PostMessage Receiver Analyst:
"Find all postMessage listeners."
Patterns:
// VULNERABLE - No origin checkwindow.addEventListener('message', (e) => {
eval(e.data.code); // RCE via any origin
});
// VULNERABLE - Weak origin checkwindow.addEventListener('message', (e) => {
if (e.origin.includes('trusted.com')) { // trusted.com.evil.com bypasses// ...
}
});
// SAFEwindow.addEventListener('message', (e) => {
if (e.origin !== 'https://trusted.com') return;
// ...
});
PostMessage Sender Analyst:
"Check postMessage sends for data leakage."
Patterns:
// VULNERABLE - Sending to any origin
parent.postMessage(sensitiveData, '*');
// VULNERABLE - Token in message
iframe.contentWindow.postMessage({ token: authToken }, '*');
# Client-Side Security Analysis## Summary
| Category | Issues Found | Critical | High | Medium |
|----------|--------------|----------|------|--------|
| React/Next.js XSS | X | Y | Z | W |
| Vue XSS | X | Y | Z | W |
| Angular XSS | X | Y | Z | W |
| DOM XSS | X | Y | Z | W |
| Server Components | X | Y | Z | W |
| Prototype Pollution | X | Y | Z | W |
| PostMessage | X | Y | Z | W |
| Client Storage | X | Y | Z | W |
## Framework Detected- Primary: [React 18, Next.js 14, Vue 3, etc.]
- SSR: [Yes/No]
- Build Tool: [Vite, Webpack, Turbopack]
## Critical Findings### [CLIENT-001] XSS via dangerouslySetInnerHTML**Severity:** Critical
**Framework:** React
**Location:**`components/Comment.tsx:23`**Vulnerable Code:**```jsx
<div dangerouslySetInnerHTML={{ __html: comment.body }} />