nextjs-attack-probe
Installation
SKILL.md
Next.js Attack Probe
Authorized probe of a Next.js 13+ App Router app the user owns. Follow shared probing conventions — discover base URL from package.json scripts.dev (default next dev port 3000), next.config.{js,ts} serverRuntimeConfig, Dockerfile EXPOSE, or env (PORT). Never hardcode.
Next.js-specific attack surface
NEXT_PUBLIC_*env vars are baked into the client JS bundle. Any secret with that prefix is leaked to anyone who fetches the site.- Server Actions are reachable via crafted POSTs to any page, with
Next-Action: <hash>header — no inherent auth. /_next/data/<buildId>/...json(Pages Router) and route handlers are often forgotten in middleware matchers.next/imageproxy can be coerced into SSRF ifimages.remotePatternsis too permissive.- ISR
revalidatePath/revalidateTagwith user-influenced paths → cache poisoning. x-middleware-subrequestheader bypass (CVE-2025-29927 class) — Next.js < 15.1 patches.
Procedure
- Authorization preflight + base URL discovery.
- Pull build manifest:
GET /_next/static/chunks/*.js(sample 1-2 main bundles); grep forNEXT_PUBLIC_and obvious secret shapes. - Probe per rule table.