Vulnerability GHSA-8wpr-639p-ccrj

Medium Risk
MEDIUM RISK
CVSS Score: 6.0
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
9 months ago
December 30, 2025 at 03:32 PM UTC
Nest has a Fastify URL Encoding Middleware Bypass (TOCTOU)
6.0.0-alpha.3 - 11.1.10
6.0.0-alpha.3 - 11.1.10

Summary

Nest has a Fastify URL Encoding Middleware Bypass (TOCTOU)

Details

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')). 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 /admin is 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.

Impacted packages

Timeline

Published
9 months ago
December 30, 2025 at 03:32 PM UTC
Fixed (11.1.11)
9 months ago
December 29, 2025 at 01:31 PM UTC
Last Modified
9 months ago
December 30, 2025 at 03:42 PM UTC