Skip to content

fix(api): migrate NestJS 10 → 11 to clear critical @fastify/middie auth-bypass - #1950

Merged
ChrisTouo merged 1 commit into
mainfrom
1866-api-migrate-nestjs-10-11
Sep 1, 2026
Merged

fix(api): migrate NestJS 10 → 11 to clear critical @fastify/middie auth-bypass#1950
ChrisTouo merged 1 commit into
mainfrom
1866-api-migrate-nestjs-10-11

Conversation

@ChrisTouo

@ChrisTouo ChrisTouo commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

What changed

Dependencies only — no source changes. All @nestjs/* → 11.2.3, plus the majors Fastify 5
forces (@fastify/multipart 8→10, @fastify/compress 7→9) and two packages whose peer ranges
cap at Nest 10 (@nestjs/jwt, nest-winston). Fastify 4→5 transitively.

Nothing in the code needed touching: only @Get/@Post are exposed (both CORS-safelisted), the
exception filter only reads reply.sent rather than assigning it, and the FastifyRequest
augmentation still resolves. Express 5 arrives only via a devDependency used by two specs —
production is Fastify-only.

@ChrisTouo ChrisTouo linked an issue Aug 27, 2026 that may be closed by this pull request

@ivanslabbert ivanslabbert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check why rxjs dependencies are added? We removed code dependent on rxjs (shared library), but it could be a downstream dependency in the api.

@ChrisTouo

ChrisTouo commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

Check why rxjs dependencies are added? We removed code dependent on rxjs (shared library), but it could be a downstream dependency in the api.

Unlike shared/, rxjs can't be dropped from api/ — it's a required peer dep of @nestjs/core and @nestjs/common (^7.1.0), since Nest is built on Observables. But none of our own api/src code imports it directly, so it's purely a framework requirement.

…ypass CVE

@nestjs/platform-fastify@10 pins @fastify/middie@8.3.3, which carries a critical
middleware authentication-bypass in child plugin scopes (GHSA-72c6-fx6q-fr5w).
The fix ships only in middie 9.x, which requires Fastify 5, which requires
NestJS 11 — so the major bump is the only way to close it.

platform-fastify@11 no longer depends on middie at all, and the API registers no
Express-style middleware, so the package leaves the dependency tree entirely
rather than being patched in place.

Fastify 5 forces the plugin majors (@fastify/multipart 8→10, @fastify/compress
7→9); @nestjs/jwt and nest-winston are bumped because their peer ranges cap at
NestJS 10.

No source changes were required: the API exposes only GET/POST (both CORS-
safelisted, unaffected by the Fastify 5 CORS default), the exception filter only
reads reply.sent rather than assigning it, and the FastifyRequest module
augmentation still resolves.

npm audit: 22 vulnerabilities (1 critical, 8 high, 13 moderate) → 1 (sharp,
tracked separately). Full suite unchanged at 817/817 against real CouchDB/MinIO.

Refs #1866, #1800

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ChrisTouo
ChrisTouo force-pushed the 1866-api-migrate-nestjs-10-11 branch from 11e62f0 to 1c63d19 Compare September 1, 2026 16:06
@ChrisTouo
ChrisTouo merged commit 77bfb2c into main Sep 1, 2026
6 checks passed
@ChrisTouo
ChrisTouo deleted the 1866-api-migrate-nestjs-10-11 branch September 1, 2026 16:29
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.

API: Migrate NestJS 10 → 11

2 participants