Skip to content

fix(deps): patch known CVEs in Next.js and transitive dependencies - #440

Open
keysersoft wants to merge 1 commit into
mainfrom
keysersoft/security-deps-bump
Open

fix(deps): patch known CVEs in Next.js and transitive dependencies#440
keysersoft wants to merge 1 commit into
mainfrom
keysersoft/security-deps-bump

Conversation

@keysersoft

Copy link
Copy Markdown
Contributor

Patches the known CVEs flagged by CodeQL/Trivy that we can fix without breaking changes. No application code touched — only packages/frontend/package.json (one line) and the lockfile.

Resolved

Package Before → After Advisories
next 16.2.10 → 16.2.12 4 HIGH — SSRF in Server Actions on custom servers (CVE-2026-64649), SSRF in rewrites via attacker-controlled destination host (CVE-2026-64645), middleware/proxy bypass with Turbopack + single locale (CVE-2026-64642), DoS in App Router Server Actions (CVE-2026-64641) · 4 MEDIUM (cache confusion ×2, unbounded Edge Server Action payload, image-optimization DoS via SVG, internal Server Function endpoint disclosure)
brace-expansion 1.1.14/5.0.6 → 1.1.16 / 2.1.2 / 5.0.8 2 HIGH — OOM via unbounded expansion (CVE-2026-14257), exponential-time expansion (CVE-2026-13149)
fast-uri 3.1.2 → 3.1.4 2 HIGH — CVE-2026-16221, security-policy bypass via improper Unicode hostname canonicalisation (CVE-2026-13676)
hono 4.12.18 → 4.12.32 3 MEDIUM — JSX cross-request context leak, XSS via JSX escaping bypass in cx(), header de-duplication dropping values
protobufjs 7.5.7 → 7.6.5 MEDIUM — DoS via crafted .proto schema
body-parser 2.2.2 → 2.3.0 LOW — DoS via invalid limit option

Everything except next was reachable simply by refreshing within the ranges the tree already declared (npm update), so the diff stays small.

Deliberately deferred (with reasons)

These are all exact pins held by upstream packages, so fixing them means either forcing a version our dependencies aren't tested against, or a major bump:

Package Why not now
postcss 8.4.31 / 8.5.15 (HIGH) Pinned exactly by next and the Tailwind PostCSS plugin. Build-time only, processing our own CSS — the advisory requires attacker-controlled sourceMappingURL input.
js-yaml 5.2.1 (HIGH) Pinned exactly by @nestjs/swagger, and its latest release (11.4.6) still pins 5.2.1 — there is no upstream fix to take. Used to serve our own OpenAPI document, not to parse untrusted YAML.
sharp 0.34.5 (HIGH) Sits inside next's ^0.34.5 range; jumping to 0.35 diverges from the version Next is tested against.
@hono/node-server 1.19.x (MEDIUM) Fix is a major (2.0.5). The advisory is a Windows-only serve-static path traversal; we ship Linux containers and don't use serve-static.
valibot 1.2.0, Jaeger OTel propagator 2.8.0 Exact pins reached only through dev-only paths.

Finding worth a follow-up

While attempting to force the pins above I found that the root package.json overrides block is not being honoured in this workspace — the pre-existing rxjs: 7.8.1 pin is also ineffective (7.8.2 is still installed), and the lockfile records no overrides at all. Forcing the remaining pins would therefore require regenerating the whole lockfile, which is too broad for a security patch. I'd rather fix the overrides mechanism in its own PR — happy to open an issue.

Verification

  • Backend: tsc clean, 3460 tests green
  • Frontend: tsc clean, next build clean on 16.2.12

Bumps next to ^16.2.11 (resolves 16.2.12) and refreshes transitive
dependencies whose existing ranges already allowed patched versions.

Resolved:
- next 16.2.10 -> 16.2.12: SSRF in Server Actions on custom servers
  (CVE-2026-64649) and in rewrites via attacker-controlled destination
  host (CVE-2026-64645), middleware/proxy bypass with Turbopack +
  single locale (CVE-2026-64642), DoS in App Router Server Actions
  (CVE-2026-64641), plus four medium advisories (cache confusion,
  unbounded Edge payload, image-optimization DoS via SVG, disclosure of
  internal Server Function endpoints).
- brace-expansion -> 1.1.16 / 2.1.2 / 5.0.8: OOM via unbounded expansion
  (CVE-2026-14257) and exponential-time expansion (CVE-2026-13149).
- fast-uri -> 3.1.4: CVE-2026-16221 and policy bypass via improper
  Unicode hostname canonicalization (CVE-2026-13676).
- hono -> 4.12.32: JSX cross-request context leak, JSX escaping bypass
  in cx(), header de-duplication dropping values.
- protobufjs -> 7.6.5: DoS via crafted .proto schema.
- body-parser -> 2.3.0: DoS via invalid limit option.

Deliberately not changed here, with reasons:
- postcss (8.4.31, 8.5.15) — pinned to an exact version by next and by
  the Tailwind PostCSS plugin. Build-time only, processing our own CSS;
  the advisory needs attacker-controlled sourceMappingURL input.
- js-yaml 5.2.1 — pinned exactly by the NestJS Swagger package, and its
  latest release (11.4.6) still pins it, so there is no upstream fix to
  take. Used to serve our own OpenAPI document, not to parse untrusted
  YAML.
- sharp 0.34.5 — inside next's ^0.34.5 range; moving to 0.35 would
  diverge from the version Next is tested against.
- hono node-server 1.19.x — the fix is a major (2.0.5), and the advisory
  is a Windows-only serve-static path traversal; we ship Linux
  containers and do not use serve-static.
- valibot 1.2.0 and the Jaeger OpenTelemetry propagator 2.8.0 — exact
  pins reached only through dev-only dependency paths.

Note: the root package.json overrides block is not being honoured in
this workspace (the pre-existing rxjs pin is ineffective too, and the
lockfile records no overrides at all), so the remaining exact pins
cannot be forced without regenerating the whole lockfile. Worth tracking
separately rather than widening this patch.

Backend: 3460 tests green, tsc clean. Frontend: tsc + build clean.
@keysersoft
keysersoft requested a review from mirkopoloni as a code owner July 26, 2026 11: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