CVE-2026-54281: Nest: Middleware Bypass on Fastify via Trailing Slash
Impact An authentication bypass vulnerability exists in @nestjs/platform-fastify (confirmed on version 11.1.24, the latest available release at time of report). When middleware is registered through NestJS's MiddlewareConsumer.forRoutes() API on the Fastify adapter, an unauthenticated client can bypass the Nest middleware registered for that route by simply appending a trailing slash (/) to the request URL.
Published Jun 15, 2026 · Updated Jul 18, 2026
Affected packages
@nestjs/platform-fastify
- Ecosystem
- npm
- Affected
- <= 11.1.23
- Fixed in
- 11.1.24
- Check
npm ls @nestjs/platform-fastify
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
An authentication bypass vulnerability exists in @nestjs/platform-fastify (confirmed on version 11.1.24, the latest available release at time of report). When middleware is registered through NestJS's MiddlewareConsumer.forRoutes() API on the Fastify adapter, an unauthenticated client can bypass the Nest middleware registered for that route by simply appending a trailing slash (/) to the request URL.
This bypass works on the default Fastify adapter configuration — no special router options need to be enabled. Applications using the standard CRUD route shape (GET /resource and GET /resource/:id) are affected when they protect those routes with MiddlewareConsumer.forRoutes() middleware.
Patches
Fixed in @nestjs/[email protected]
References
Kudos goes to @a-tt-om
Credited to a-tt-om, kamilmysliwiec.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesGHSA-9c5c-9qcx-q35q
@nestjs/platform-fastify: Path-scoped middleware bypass via absolute-form request targets
high7.4Sep 30, 2026CVE-2026-33011
Nest Fastify HEAD Request Middleware Bypass
high8.7Mar 17, 2026CVE-2026-2293
Nest has a Fastify URL Encoding Middleware Bypass
high8.2Mar 2, 2026CVE-2025-69211
Nest has a Fastify URL Encoding Middleware Bypass (TOCTOU)
medium6.9Dec 30, 2025
