Skip to content

chore(deps): bump next to 16.3.4 and sharp to 0.35.4, replacing #732 and #735 - #741

Merged
Ardnived merged 2 commits into
mainfrom
claude/chore-deps-next-16-3
Sep 9, 2026
Merged

Ardnived merged 2 commits into
mainfrom
claude/chore-deps-next-16-3

Conversation

@sydevs-bot

Copy link
Copy Markdown
Contributor

Summary

Advisory Severity Vulnerable In #732's 16.2.11? In #735?
GHSA-2xp9-vwfh-vxw4 — RCE in the Image Optimization API critical >=16.0.0 <16.3.3 still vulnerable not addressed
GHSA-p293-qw3h-jr36 — RCE on Windows-hosted servers critical >=16.0.0 <16.3.3 still vulnerable not addressed

The Image Optimization API is reachable here: /_next/image is public and unauthenticated, and next.config.mjs:69-90 declares three remotePatterns. The Windows one is not — Railway runs Linux — but it is cleared by the same bump.

Why one PR does the work of two

[email protected] declares sharp: "^0.35.4" as its own optional dependency. [email protected] declares ^0.34.5, and a caret on a 0.x line pins the minor — which is the only reason #735 needed an overrides entry at all. Move next and the entry becomes unnecessary:

  • pnpm why next → one version, 16.3.4.
  • pnpm why sharp → one version, 0.35.4, resolved through next and through our own dependency.
  • pnpm-workspace.yaml is untouched by this PR.

Changes

  • package.json — next ^16.2.6 → ^16.3.4, eslint-config-next likewise (keeps the lint rules on next's own minor), sharp ^0.34.5 → ^0.35.4.
  • pnpm-lock.yaml — the resolution.
  • README.md, AGENTS.md — a separate docs: commit, correcting two "Next.js 15" lines. Both were already stale against main's 16.2.6.

No source file changes, and pnpm-workspace.yaml is untouched. Two commits, one behaviour each.

The security claim, measured

pnpm audit, run twice today — once against origin/main's lockfile, once against this branch:

Package main this branch
next 6 (2 critical) 0
sharp 2 0
fast-uri 6 6
brace-expansion 5 5
js-yaml 2 2
image-size 2 2
nanoid 2 2
browserslist 2 2
postcss 1 1
socket.io-parser 1 1
undici 1 1
nodemailer 1 1
high + critical 31 23
moderate 20 15

Both next criticals and both sharp highs are gone. Nothing else moved, in either direction. GitHub's own push-time warning on main reports the same shape: "2 critical, 29 high, 19 moderate".

Breaking changes in 16.3, each checked rather than assumed

Read from the 16.3.0 release notes and the 16.3 blog post, then checked against this repo. 16.3.1–16.3.4 carry no breaking changes; 16.3.3 is the security release and 16.3.4 re-enables AVIF optimization.

Change Effect here
Edge Runtime deprecated (warns; nodejs replaces it) No route exports runtime anywhere in src/. src/middleware.ts still compiles to Edge, so the warning may appear — a warning, not a failure.
middleware convention deprecated in favour of proxy We have src/middleware.ts:15. Pre-existing since 16.0, not introduced here: the same warning string is in 16.2.6. proxy is nodejs-only, and src/plugins/cache/policy.ts:8-9 is built around the Edge bundle — so the migration is a decision, not a rename. Named as a follow-up below.
unstable_instant → instant(), unstable_io() → io() Unused.
experimental.useCache deprecated Unused. next.config.mjs declares no experimental block at all.
experimental.dynamicIO, viewTransition, partialFallbacks, useNodeStreams, instantNavigationDevToolsToggle removed All unused, for the same reason.
Node streams replace web streams in App Router SSR, with no flag Inherited, nothing to configure.
Service workers now emit to /_next/static/ No service worker in src/.
New segment configs instant / unstable_dynamicStaleTime (mutually exclusive, hard error) Neither is used.
Node engine Unchanged: >=20.9.0 in both 16.2.6 and 16.3.4. .node-version is 22.17.0.

unstable_cache is still exported by 16.3.4 (node_modules/next/cache.d.ts:1), so src/lib/atlasSidebar/getAtlasSidebarData.ts:21,180 needs no change. revalidateTag(ATLAS_SIDEBAR_TAG, 'max') already passes the 16.0 profile argument.

Two defaults that changed, measured against the 16.2.6 tarball rather than the blog

  • experimental.turbopackFileSystemCacheForBuild: false → true. Build-time compiler artifacts now cache to disk. It only bites a Turbopack build, and ours is webpack (below), so the effect here is nil — but it is a real default change on Railpack.
  • agentRules is new (absent from 16.2.6's config-shared.js, present in 16.3.4's). next dev writes a managed block into AGENTS.md when it detects an agent in the environment. This repo's CLAUDE.md is a symlink to AGENTS.md, so a local pnpm dev may now produce an uncommitted diff in the agent guide. agentRules: false opts out. Not set here — see the follow-ups.

The Turbopack/webpack build gate is not a regression

16.3.4 hard-exits (process.exit(1)) when TURBOPACK=auto, a webpack config exists and no turbopack config does — node_modules/next/dist/lib/turbopack-warning.js:157. next.config.mjs:32-40 has a webpack key and no turbopack key, so this reads like a broken Railway build.

It is not. The identical gate is in 16.2.6, at the same line number, verified by unpacking the 16.2.6 tarball — and pnpm build is green here regardless. Flagging it because it looks alarming in the 16.3 source and someone will find it again.

The image optimizer, since that is where the critical lives

GHSA-2xp9-vwfh-vxw4 is a libheif heap overflow reached through sharp when Next optimizes an attacker-controlled AVIF. 16.3.3 patched it by disabling AVIF optimization; 16.3.4 re-enables it on a fixed path.

Reachability here, both ways:

  • /_next/image is public and unauthenticated, and next.config.mjs:69-90 allows the R2 delivery host, **.cloudflarestream.com and img.shields.io — the optimizer does fetch third-party-influenced bytes.
  • images.formats defaults to ["image/webp"] in 16.3.4 and we never override it, so AVIF output is not enabled on this deployment. That also retires chore(deps): bump sharp to 0.35.4 for the libvips CVEs, and override next's nested copy #735's "AVIF retuning will change byte sizes" caveat, and explains why its adversarial review could not get an AVIF response out of the preview: there was none to get.

The bump is still the fix. The default is a mitigation, not a patch.

Test results

Full Tier 3 locally, not the lean gate — a framework minor moves payload's resolved tree, and CI does not build this app.

  • Lint: ✓ pnpm lint
  • Typecheck: ✓ pnpm typecheck, ✓ pnpm typecheck:tests
  • Unit: ✓ 128 files, 1669 tests
  • Integration: ✓ 73 files, 1199 tests (VITEST_INT_MAX_FORKS=2, per chore(deps): bump next to 16.2.11 for the reachable Server Actions DoS #732's note)
  • Build: ✓ pnpm build — compiled in 48s, standalone-postbuild copied .next/static and public/. The build ran on webpack, and printed exactly one warning: the pre-existing middleware → proxy deprecation.
  • pnpm install --frozen-lockfile: ✓ clean, no undecided-build-script error.
  • pnpm why next → one version, 16.3.4. pnpm why sharp → one version, 0.35.4.

Targeted specs: none. No source file changes, so no spec covers this diff; the evidence is the suites above passing against the new tree, plus the audit table.

What the lockfile actually moves

Tight, and all of it downstream of the two packages:

  • next 16.3.4 with its eight @next/swc-* binaries, @next/env, and @swc/helpers 0.5.15 → 0.5.23.
  • sharp 0.35.4 with every @img/sharp-* platform package, @img/sharp-libvips-* 1.2.4 → 1.3.3, @img/colour 1.0.0 → 1.1.0, and a new @emnapi/runtime. Two new optional platform targets appear (freebsd-wasm32, webcontainers-wasm32); neither installs on Linux x64.
  • eslint-config-next / @next/eslint-plugin-next 16.3.4.
  • Peer-suffix rewrites on the @payloadcms/* and @sentry/nextjs keys, because sharp 0.35 adds an optional @types/node peer, so next's peer key gains (@types/[email protected]).

It does not carry #732's incidental cascade: no rollup, terser, dompurify, ws, vite or vitest movement, and no @napi-rs/lzma-linux-x64-gnu — the optional native package #732 flagged for excluding our Node version is absent from this tree.

Notes for reviewer

Refs #721

🤖 Written by the sydevs autonomous loop — see what this is

🤖 Generated with Claude Code

https://claude.ai/code/session_01KMbSpgLANf3FccYW7xJPRv


Generated by Claude Code

sydevs-bot and others added 2 commits September 9, 2026 15:07
Supersedes #732 (next 16.2.11) and #735 (sharp 0.35.4 + an overrides
entry). One bump replaces both, and clears strictly more.

The failure this prevents: two CRITICAL advisories that neither open PR
reaches. Both are unauthenticated remote code execution, and both are
fixed only in next 16.3.3 —

  GHSA-2xp9-vwfh-vxw4  RCE in the Image Optimization API  >=16.0.0 <16.3.3
  GHSA-p293-qw3h-jr36  RCE on Windows-hosted servers      >=16.0.0 <16.3.3

16.2.11, the target of #732, is inside both ranges. No sharp bump
reaches either.

next 16.3.4 declares sharp ^0.35.4 as its own optional dependency, so
bumping our direct `sharp` to ^0.35.4 leaves one copy in the tree with
no overrides entry at all. #735 needed one only because next 16.2.x
declares ^0.34.5, a caret on a 0.x line, which pins the minor.

Measured against origin/main's lockfile on the same day:
high+critical 31 -> 23, moderate 20 -> 15. next 6 -> 0, sharp 2 -> 0.

eslint-config-next moves with next to keep the lint rules on the same
minor.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KMbSpgLANf3FccYW7xJPRv
Both lines predate this PR — main is already on next 16.2.6 — but a PR
that moves the Next minor is where a reader will check them.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KMbSpgLANf3FccYW7xJPRv
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-741 September 9, 2026 15:15 Destroyed
@railway-app

railway-app Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-741 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Sep 9, 2026 at 3:20 pm UTC
1 service not affected by this PR
  • mailpit

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-741 — 9b989575 Deployed Sep 9, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants