Skip to content

fix(security): patch SSRF + high-severity CVEs in next + OpenNext#44

Merged
MP2EZ merged 2 commits into
previewfrom
fix/security-deps-update
May 31, 2026
Merged

fix(security): patch SSRF + high-severity CVEs in next + OpenNext#44
MP2EZ merged 2 commits into
previewfrom
fix/security-deps-update

Conversation

@MP2EZ
Copy link
Copy Markdown
Owner

@MP2EZ MP2EZ commented May 31, 2026

Summary

Closes the critical finding from `/m:audit --security`: 51 → 4 npm vulnerabilities, eliminating both production-runtime CVEs.

Package From To Why
`@opennextjs/cloudflare` 1.14.4 1.19.11 SSRF via `/cdn-cgi/` path-normalization bypass (GHSA-c7mq-gh6q-6q7c) — the live Cloudflare Workers server adapter
`next` 16.0.10 16.2.6 High-severity set: Server-Actions CSRF (null origin), middleware/proxy bypass, RSC cache poisoning, image-optimizer DoS
`eslint-config-next` 16.0.7 16.2.6 Track next

Plus `npm audit fix` for transitive criticals (fast-xml-parser, serialize-javascript, minimatch, etc.).

Why the OpenNext SSRF matters even as a devDependency

`@opennextjs/cloudflare` is a build tool (`opennextjs-cloudflare build`), so npm classifies it as dev. But the built worker bundle ships its runtime shim — the SSRF reaches production. This was the audit's single 🔴 critical, prioritized accordingly.

The 4 remaining vulns are intentionally left

All moderate, all build-chain transitives (`postcss` XSS via next, `@opennextjs/aws`). npm's only offered "fix" is a catastrophic downgrade:

  • `next` → 9.3.3 (would destroy the app)
  • `@opennextjs/cloudflare` → 1.14.1 (would reintroduce the SSRF this PR fixes)

They're build-time only (PostCSS never serves user content), no real runtime exposure, no forward fix available. Do NOT run `npm audit fix --force` — it would downgrade into the vulnerabilities we just patched.

Verification

  • `npm audit`: 51 → 4 (0 critical, 0 high; 4 moderate build-chain with no safe fix)
  • `npm run lint` — clean
  • `npm run typecheck` — clean
  • `npm test` — 80 pass
  • `npm run build` — all 17 routes static
  • `npx opennextjs-cloudflare build` — worker.js produced (the patched adapter builds correctly)
  • CI wrangler-smoke + post-deploy smoke will re-verify on this PR

Note on version ceiling

16.3.x is canary-only right now; 16.2.6 is the latest stable 16.x, so that's the target. When 16.3.x goes stable with further fixes, a follow-up bump is worth it.

Follow-up (separate, not in this PR): waitlist rate limiting (SEC-02)

The audit also flagged `/api/waitlist` has no rate limiting — an unauthenticated POST that writes a Notion row + spends quota per call. Now that the splash is down and the site is live, this is worth doing. Best handled as a Cloudflare WAF rate-limit rule (dashboard, keyed on `CF-Connecting-IP`) rather than code, since there's no KV/DO binding wired up. Flagging for @MP2EZ to add in the Cloudflare dashboard — not blocking this PR.

🤖 Generated with Claude Code

Audit (/m:audit --security) flagged 51 npm vulns, 2 hitting the
production runtime:

- @opennextjs/cloudflare 1.14.4 → 1.19.11: SSRF via /cdn-cgi/
  path-normalization bypass (GHSA-c7mq-gh6q-6q7c). This is the live
  Cloudflare Workers server adapter — the built worker ships its
  runtime shim, so even though it's a devDependency the vuln reaches
  production. Highest-priority fix.
- next 16.0.10 → 16.2.6: high-severity set (Server-Actions CSRF via
  null origin, middleware/proxy bypass, RSC cache poisoning,
  image-optimizer DoS). Several target the middleware GPC/AB surface.

Also bumped eslint-config-next to match (16.2.6) and ran npm audit fix
for transitive criticals (fast-xml-parser, serialize-javascript,
minimatch, etc.).

Result: 51 → 4 vulns. The remaining 4 are all moderate build-chain
transitives (postcss XSS via next, @opennextjs/aws) whose only
"fix" npm offers is a catastrophic downgrade — next→9.3.3 (destroys
the app) or @opennextjs→1.14.1 (reintroduces the SSRF just fixed).
They are build-time only (PostCSS never serves user content) with no
real runtime exposure and no forward fix available, so they are left
intentionally. Do NOT run `npm audit fix --force`.

Verified: lint + typecheck clean, 80 tests pass, `next build` +
`opennextjs-cloudflare build` both succeed (worker.js produced).

Note: 16.3.x is canary-only; 16.2.6 is the latest stable 16.x.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The @opennextjs/cloudflare 1.19.11 upgrade in this PR pulls a newer
transitive wrangler that requires Node.js >= 22. CI's setup-node was
pinned to node-version 20, so `wrangler dev` aborted on startup with
"Wrangler requires at least Node.js v22.0.0" — the wrangler-smoke job's
worker never came up and the readiness probe timed out.

Bumps node-version 20 → 22 in both ci.yml (Lint+Tests, wrangler-smoke)
and deploy.yml. This is distinct from the earlier Actions-runtime bump
(PR #38: checkout/setup-node action versions) — that was the action's
own Node runtime; this is the Node the action provisions for the
project toolchain.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MP2EZ MP2EZ merged commit 0a3b3c2 into preview May 31, 2026
2 checks passed
@MP2EZ MP2EZ deleted the fix/security-deps-update branch May 31, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant