/viperclaw:viper-nextjs-react-rscfrom viperclaw
Audits Next.js App Router, React Server Components, and Server Actions for security issues including authorization gaps in 'use server' functions, NEXT_PUBLIC_ environment variable leaks, and prop serialization vulnerabilities.
Ships in viperclaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
viper-nextjs-react-rsc)p/nextjs & p/react."use server" Server Actions, React Server Components (RSC), and middleware.ts.flowchart LR
Browser["Client Component"] --> Action["Server Action (Auth + Zod)"] --> DAL["Data Access Layer (Tenant Scoped)"] --> RSC["DTO-Filtered RSC Flight Stream"]
viperclaw harvest-js ./.next --db .viperclaw/graph.db
"use server", 'use server', NEXT_PUBLIC_, dangerouslySetInnerHTML, headers(), cookies(), NextResponse.next()."use server" function is a public HTTP POST endpoint; verify that each Server Action independently authenticates the session and validates input with zod before mutating data.experimental_taintObjectReference): Never pass full ORM database objects (user) directly from a Server Component into a "use client" component, as all serialized props are sent in the RSC serialized stream to the browser. Use DTO mappers or server-only modules.NEXT_PUBLIC_ Environment Variable Hygiene: Audit .env* and next.config.js to confirm no private API keys, database URLs, or signing secrets use the NEXT_PUBLIC_ prefix.matcher): Do not rely solely on middleware.ts path matchers for authentication; enforce authorization inside the Data Access Layer (DAL) on every query and mutation.next/image SSRF Prevention: Restrict images.remotePatterns in next.config.js to specific trusted hostnames/paths and validate redirect() targets against a relative-path check.// ❌ VULNERABLE: Server Action trusts client-supplied userId without session check
"use server";
export async function updateEmail(userId: string, newEmail: string) {
await db.user.update({ where: { id: userId }, data: { email: newEmail } });
}
// ✅ HARDENED: Authenticates caller & validates input schema inside Server Action
"use server";
import { z } from "zod";
const EmailSchema = z.object({ newEmail: z.string().email() });
export async function updateEmail(formData: unknown) {
const session = await requireVerifiedSession();
const { newEmail } = EmailSchema.parse(formData);
await db.user.update({ where: { id: session.user.id }, data: { email: newEmail } });
}
Next.js App Router Security, OWASP Top 10 A01/A04, CWE-285, CWE-200| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.0–10.0) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | Unauthenticated remote code execution, cross-tenant authentication or isolation gap, or direct theft of funds/keys. |
| HIGH (7.0–8.9) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N | Authenticated privilege escalation, unauthorized sensitive data exposure, or single-request service outage. |
| MEDIUM (4.0–6.9) | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N | Scoped information disclosure, non-admin state mutation, or configuration weakness requiring user interaction. |
| LOW (0.1–3.9) | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N | Defense-in-depth hardening gap requiring high precondition complexity and minimal direct impact. |
viperclaw harvest-js ./.next --db .viperclaw/graph.db and viperclaw verify to record the verified state in .viperclaw/graph.db.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
nextjs-security, server-actions, rsc-audit, app-router, security-review
npx claudepluginhub zahidoverflow/viperclaw --plugin viperclaw72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas.Other plugins' skills for the same job