Skip to content

security: patch Next.js RCE + all advisories; unpublish Postgres - #118

Merged
goetchstone merged 2 commits into
mainfrom
security/patch-next-rce
Sep 30, 2026
Merged

goetchstone merged 2 commits into
mainfrom
security/patch-next-rce

Conversation

@goetchstone

Copy link
Copy Markdown
Owner

Why

Two months of advisories had accumulated since #106, including a critical unauthenticated RCE in the Next.js image optimizer (GHSA-2xp9-vwfh-vxw4). The optimizer is live on akritos.com (/_next/image → 200, used by the blog) and we were on 16.2.12.

Dependencies — npm audit: 0 vulnerabilities (prod and dev, all severities)

  • next 16.2.12 → 16.3.7 (+ eslint-config-next in lockstep): both critical RCEs
  • nodemailer 9 → 10.0.13: 9.x has no fix for a high addressparser ReDoS. Dropped @types/nodemailer (v10 ships its own types) and removed the Dependabot rules that pinned nodemailer's major, which is how it fell behind
  • sharp 0.35.5 (libheif), js-yaml 4.3.2, browserslist 4.29.3, fflate, brace-expansion, vitest — override floors raised by hand (npm audit fix/npm update crash on the $nodemailer override; noted in CLAUDE.md)
  • shadcn → devDependencies: it's a CLI plus one build-time CSS import, and only .next/standalone ships, so its MCP SDK tree (hono, express, ip-address) never runs on the server
  • Removed the now-dead postcss allowlist entry. The allowlist is empty.

Infra — Postgres was published on the VPS's public interface

docker-compose.prod.yml set db.ports: [], but Compose merges port lists, so docker compose config showed 5432 published on all interfaces. The DB password is the dev default hardcoded in this public repo. The DreamCompute security group (only 22/80/443 reachable, verified externally) was the only thing in the way. Postgres and Mailpit are now bound to 127.0.0.1; the app port is unchanged because the host reverse proxy needs it.

Verified

  • prisma generate, tsc, 85 tests, npm run build: clean
  • npm ci from lockfile + audit gate: pass (empty allowlist)
  • Semgrep whole repo, no exclusions: 0 findings
  • Merged prod compose config: db → 127.0.0.1:5432

Deploy note

CI auto-deploy is off, so this needs a manual deploy.sh. The port-binding change recreates the db container (brief restart; data is in the named volume).

🤖 Generated with Claude Code

Next 16.3.7 fixes an unauthenticated image-optimizer RCE (GHSA-2xp9).
nodemailer 10 (9.x has no ReDoS fix); shadcn is build-only, so devDeps.
npm audit: 0 vulnerabilities, prod and dev.
Compose merges port lists, so the prod `ports: []` never unpublished
5432; only the cloud firewall kept it off the internet.
@goetchstone
goetchstone merged commit 3f3bff4 into main Sep 30, 2026
8 checks passed
@goetchstone
goetchstone deleted the security/patch-next-rce branch September 30, 2026 09:55
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