CVE-2025-69211: Nest has a Fastify URL Encoding Middleware Bypass (TOCTOU)
A NestJS application is vulnerable if it meets all of the following criteria: 1. Platform: Uses @nestjs/platform-fastify. 2. Security Mechanism: Relies on NestMiddleware (via MiddlewareConsumer) for security checks (authentication, authorization, etc.), or through app.use() 3. Routing: Applies middleware to specific routes using string paths or controllers (e.g., .forRoutes('admin')).
Published Dec 30, 2025
Affected packages
@nestjs/platform-fastify
- Ecosystem
- npm
- Affected
- < 11.1.10
- Fixed in
- 11.1.11
- Check
npm ls @nestjs/platform-fastify
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
A NestJS application is vulnerable if it meets all of the following criteria:
- Platform: Uses
@nestjs/platform-fastify. - Security Mechanism: Relies on
NestMiddleware(viaMiddlewareConsumer) for security checks (authentication, authorization, etc.), or throughapp.use() - Routing: Applies middleware to specific routes using string paths or controllers (e.g.,
.forRoutes('admin')).
Example Vulnerable Config:
// app.module.ts
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
consumer
.apply(AuthMiddleware) // Security check
.forRoutes('admin'); // Vulnerable: Path-based restriction
}
}Attack Vector:
- Target Route:
/admin - Middleware Path:
admin - Attack Request:
GET /%61dmin - Result: Middleware is skipped (no match on
%61dmin), but controller for/adminis executed.
Consequences:
- Authentication Bypass: Unauthenticated users can access protected routes.
- Authorization Bypass: Restricted administrative endpoints become accessible to lower-privileged users.
- Input Validation Bypass: Middleware performing sanitization or validation can be skipped.
Patches
Patched in @nestjs/[email protected]
Resources
Credit goes to Hacktron AI for reporting this issue.
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-54281
Nest: Middleware Bypass on Fastify via Trailing Slash
high8.7Jun 15, 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, 2026
