نسخههای متأثر
- نسخههای متأثر
- < 11.1.10
- نسخهٔ اصلاحشده
- 11.1.11
بهرهبرداری
شرح آسیبپذیری
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:
/adminMiddleware Path:
adminAttack Request:
GET /%61dminResult: 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/platform-fastify@11.1.11
Resources
Credit goes to Hacktron AI for reporting this issue.

