Time-of-check Time-of-use (TOCTOU) Race Condition Affecting @nestjs/platform-fastify package, versions <11.1.11


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.05% (15th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Time-of-check Time-of-use (TOCTOU) Race Condition vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-NESTJSPLATFORMFASTIFY-14724255
  • published30 Dec 2025
  • disclosed29 Dec 2025
  • creditHacktron AI

Introduced: 29 Dec 2025

CVE-2025-69211  (opens in a new tab)
CWE-367  (opens in a new tab)

How to fix?

Upgrade @nestjs/platform-fastify to version 11.1.11 or higher.

Overview

@nestjs/platform-fastify is a Nest - modern, fast, powerful node.js web framework (@platform-fastify)

Affected versions of this package are vulnerable to Time-of-check Time-of-use (TOCTOU) Race Condition in the URL encoding middleware, allowing it to be bypassed in certain configurations. An attacker can gain unauthorized access to protected routes or administrative endpoints.

To be vulnerable, an application must be applying security checks via NestMiddleware/MiddlewareConsumer or app.use(), and must apply middleware to specific routes using string paths or controllers. See the vulnerable example below.

// app.module.ts
export class AppModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer
      .apply(AuthMiddleware) // security check
      .forRoutes('admin');   // string-based rule
  }
}

PoC

Target Route: /admin

Middleware Path: admin

Attack Request: GET /%61dmin

Result: Middleware is skipped (no match on %61dmin), but controller for /admin is executed.

References

CVSS Base Scores

version 4.0
version 3.1