Skip to content

fix(security): upgrade Next.js to 15.5.24+ and sharp to 0.35.4+ (dashboard) - #754

Merged
unjica merged 1 commit into
developfrom
codex/security-next-15-5-24
Oct 9, 2026
Merged

unjica merged 1 commit into
developfrom
codex/security-next-15-5-24

Conversation

@unjica

@unjica unjica commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

The production App Router dashboard currently resolves Next.js 15.5.18 and sharp 0.34.5. Upgrade the dashboard dependency and root override to ^15.5.24, add sharp override ^0.35.4, and refresh the pnpm 9 lockfile. The resolved versions are Next 15.5.18 → 15.5.27 and sharp 0.34.5 → 0.35.5 (before: original lockfile; after: recursive pnpm why). Caret bounds keep Next on 15.x. packages/telemetry-next/package.json retains its customer-facing next: ">=14" peer dependency unchanged.

Server Actions DoS (CVE-2026-64641) is confirmed reachable: App Router has public unauthenticated Server Actions, including auth/contact/marketing. AVIF Image Optimization RCE is likely unreachable: no remotePatterns and avatar uploads are magic-byte restricted to JPEG/PNG/WebP; upgrade is defense in depth. Windows RCE (CVE-2026-75604) is not applicable to Railway's Linux runtime, but protects Windows self-hosters.

Advisories (sanity-checked against GitHub's advisory API on 2026-10-09; ranges below are the relevant pre-16 branch):

  • GHSA-m99w-x7hq-7vfj (high): Next.js: Denial of Service in App Router using Server Actions. Relevant vulnerable range >= 13.0.0, < 15.5.21; first patched version 15.5.21.
  • GHSA-2xp9-vwfh-vxw4 (critical): Next.js: Unauthenticated Remote Code Execution in Image Optimization API when AVIF files are used. Relevant vulnerable range >= 10.0.0, < 15.5.24; first patched version 15.5.24.
  • GHSA-p293-qw3h-jr36 (critical): Next.js: Unauthenticated Remote Code Execution on windows-hosted servers. Relevant vulnerable range >= 13.4.0, < 15.5.24; first patched version 15.5.24.
  • GHSA-p9j2-gv94-2wf4 (high): Next.js: Server-Side Request Forgery in rewrites via attacker-controlled destination hostname. Relevant vulnerable range >= 12.0.0, < 15.5.21; first patched version 15.5.21.
  • GHSA-89xv-2m56-2m9x (high): Next.js: Server-Side Request Forgery in Server Actions on custom servers. Relevant vulnerable range >= 14.1.1, < 15.5.21; first patched version 15.5.21.
  • GHSA-4c39-4ccg-62r3 (medium): Next.js: Unbounded Server Action payload in Edge runtime. Relevant vulnerable range >= 13.0.0, < 15.5.21; first patched version 15.5.21.
  • GHSA-955p-x3mx-jcvp (medium): Next.js: Unauthenticated disclosure of internal Server Function endpoints. Relevant vulnerable range >= 13.0.0, < 15.5.21; first patched version 15.5.21.
  • GHSA-68g3-v927-f742 (medium): Next.js: Cache confusion of response bodies for requests with bodies. Relevant vulnerable range >= 13.0.0, < 15.5.21; first patched version 15.5.21.
  • GHSA-4633-3j49-mh5q (medium): Next.js: Cache confusion of response bodies for requests with bodies containing invalid UTF-8 byte sequences. Relevant vulnerable range >= 13.0.0, < 15.5.21; first patched version 15.5.21.
  • GHSA-q8wf-6r8g-63ch (medium): Next.js: Denial of Service in the Image Optimization API using SVGs. Relevant vulnerable range >= 15.5.0, < 15.5.21; first patched version 15.5.21.
  • GHSA-rgj7-g3m4-5g8c (high): sharp: Vulnerabilities in libheif: GHSA-g89c-p67h-r497 and GHSA-2jg2-4ch7-h545. Relevant vulnerable range < 0.35.4; first patched version 0.35.4.
  • GHSA-f88m-g3jw-g9cj (high): sharp inherited vulnerabilities in libvips: CVE-2026-33327, CVE-2026-33328, CVE-2026-35590, CVE-2026-35591. Relevant vulnerable range < 0.35.0; first patched version 0.35.0.

Validation used corepack pnpm (pnpm 9.15.9), Node 24.10.0 on macOS. Production remains node:20-slim Linux; no Docker/Linux build was run here. Registry metadata confirms Next supports sharp ^0.34.3 || ^0.35.3, and sharp requires Node >=20.9.0.

  • corepack pnpm install: passed. Removed an unrelated browserslist snapshot deduplication; no unrelated package versions upgraded.
  • corepack pnpm install --frozen-lockfile: passed, including after restoring final files following baseline checks.
  • corepack pnpm why -r next and corepack pnpm why -r sharp: every Next resolution is 15.5.27 (>=15.5.24, <16), every sharp resolution is 0.35.5 (>=0.35.4).
  • corepack pnpm lint: passed, zero warnings/errors.
  • corepack pnpm build: passed for all seven workspace projects, including TypeScript SDK/API compilation and dashboard production type validation. Dashboard log: Next.js 15.5.27; 56/56 static pages generated. Repeated successfully after baseline checks.
  • corepack pnpm test: passed, 1,411 tests passed, 128 skipped, zero failed. Vitest: 185 files passed, 18 skipped; publish guards: 10 suites passed.
    • API: 1,044 passed, 128 skipped; 131 files passed, 18 skipped.
    • Dashboard: 227 passed in 41 files.
    • Core: 67 passed in 9 files.
    • Vite plugin: 14 passed in 1 file.
    • Node SDK: 27 passed in 2 files.
    • Next SDK: 15 passed in 1 file.
    • Publish guards: 17 passed, zero skipped/failed.
  • Additional corepack pnpm --filter dashboard exec tsc --noEmit: exits 2 with six pre-existing errors: four TS2540 errors assigning readonly NODE_ENV in lib/google-analytics.test.ts (22, 30, 37, 46), two TS1501 errors for regex flags with ES2017 target in lib/marketing-seo-head.test.ts (13, 14). Next production build type validation passes.
  • Baseline checks in this same worktree: temporarily copied the three dependency files from origin/develop using read-only git show, installed its frozen lockfile, ran corepack pnpm --filter api test (same 1,044 passed / 128 skipped), corepack pnpm --filter dashboard exec tsc --noEmit (identical six errors), and corepack pnpm --filter dashboard build (passed, Next 15.5.18). Restored final dependency files and reinstalled/rebuilt. No git metadata was changed.
  • Smoke: corepack pnpm --filter dashboard start --port 3107; curl -sI http://localhost:3107/ and /contact both returned 200. For /_next/image?url=%2Fog-banner.png&w=640&q=75, first cold-cache curl -sI returned 400 with “internal image response is empty”; GET (curl -s -o /tmp/sec-next-final-image.bin -w '%{http_code}\n' 'http://localhost:3107/_next/image?url=%2Fog-banner.png&w=640&q=75') returned 200, and subsequent HEAD returned 200. Reproduced the same cold-cache HEAD 400 / GET 200 behavior using baseline Next 15.5.18 and its production build with the image cache moved aside. Final smoke: homepage/contact HEAD 200, image GET 200 and warm HEAD 200. Local servers stopped.
  • git diff origin/develop... is empty because HEAD equals origin/develop; reviewed the uncommitted changes with git diff origin/develop and git diff --check (passed). Only the three intended dependency files remain changed. Restored the install/build-generated API version comment; no generated output is included.

The 128 skipped API tests are gated by existing RUN_DB_INTEGRATION_TESTS / RUN_BRIEF_INTEGRATION_TESTS flags, with the same skips on origin/develop. DB-backed integration tests are to be verified by CI with its Postgres service; they were not enabled locally. No tests were weakened. Existing Sentry navigation-hook and webpack/browserslist notices remain outside scope.

Production deploy happens only via the normal release workflow after review. API on Railway installs with unlocked npm install and is not affected by this PR. No merge, deployment, package publishing, production data access, branch creation, commit, push, or PR mutation was performed. Runner should create a non-draft PR against develop; gh pr list --head codex/security-next-15-5-24 --state all found none.

Constrain Next.js to ^15.5.24 and override sharp to ^0.35.4.
Refresh the pnpm 9 lockfile to Next.js 15.5.27 and sharp 0.35.5
to address Server Actions DoS and image optimization advisories.
Preserve the customer-facing telemetry-next peer dependency.
@unjica
unjica merged commit 6e8012b into develop Oct 9, 2026
7 checks passed
@unjica unjica mentioned this pull request Oct 9, 2026
4 of 6 tasks
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