CVE-2025-69211: @nestjs/platform fastify Nest Has A Fastify URL Vulnerability

MODERATE
Advisory Identifier: GHSA-8wpr-639p-ccrj
CWE-367
Published
Advisory Summary

CVE-2025-69211 is a MODERATE nest has a fastify url vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting @nestjs/platform fastify libraries in the npm ecosystem. The issue involves nest has a fastify url encoding middleware bypass (toctou). Remediation is available by upgrading affected packages to version 11.1.11.

CVE-2025-69211 at a Glance

CVE Identifier CVE-2025-69211
GHSA Identifier GHSA-8wpr-639p-ccrj
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Affected Product @nestjs/platform fastify
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-69211

To remediate this vulnerability, upgrade all affected @nestjs/platform fastify dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@nestjs/platform-fastify fixed: 11.1.11
npm install @nestjs/platform-fastify@11.1.11
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @nestjs/platform-fastify

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-69211, inspect your project dependencies using npm:

npm ls @nestjs/platform-fastify

Analyze the terminal output to locate any version of @nestjs/platform fastify in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.1.11), your application is affected.

Note: The npm ls @nestjs/platform-fastify command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In @nestjs/platform fastify, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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: ```ts // 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/platform-fastify@11.1.11` ### Resources Credit goes to Hacktron AI for reporting this issue.

CVE-2025-69211 Affected @nestjs/platform fastify Versions

1 component(s)
Fixed Versions:
11.1.11
Product / Package Ecosystem Affected Versions Fixed Version
@nestjs/platform-fastify
npm
< 11.1.11
11.1.11

References

Frequently Asked Questions

What is CVE-2025-69211?
CVE-2025-69211 is a security vulnerability in @nestjs/platform fastify involving Nest has a Fastify URL Encoding Middleware Bypass (TOCTOU) under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which @nestjs/platform fastify versions are affected?
Affected versions include releases prior to 11.1.11 across affected packages: @nestjs/platform-fastify.
What version fixes CVE-2025-69211?
Upgrading to 11.1.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @nestjs/platform-fastify affected?
Yes, @nestjs/platform-fastify is affected in releases prior to 11.1.11. Upgrade your dependency to 11.1.11 or later.
What CWE is associated with CVE-2025-69211?
CVE-2025-69211 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.).
How can I check npm dependencies for CVE-2025-69211?
Run the dependency tree command: 'npm ls @nestjs/platform-fastify'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8wpr-639p-ccrj",
  "modified" : "2025-12-30T15:32:44Z",
  "published" : "2025-12-30T15:32:44Z",
  "aliases" : [ "CVE-2025-69211" ],
  "summary" : "Nest has a Fastify URL Encoding Middleware Bypass (TOCTOU)",
  "details" : "A NestJS application is vulnerable if it meets all of the following criteria:\n\n1. Platform: Uses `@nestjs/platform-fastify`.\n2. Security Mechanism: Relies on `NestMiddleware` (via `MiddlewareConsumer`) for security checks (authentication, authorization, etc.), or through `app.use()`\n3. Routing: Applies middleware to specific routes using string paths or controllers (e.g., `.forRoutes('admin')`).\nExample Vulnerable Config:\n\n```ts\n// app.module.ts\nexport class AppModule implements NestModule {\n  configure(consumer: MiddlewareConsumer) {\n    consumer\n      .apply(AuthMiddleware) // Security check\n      .forRoutes('admin');   // Vulnerable: Path-based restriction\n  }\n}\n```\n\nAttack Vector:\n\n- Target Route: `/admin`\n- Middleware Path: `admin`\n- Attack Request: `GET /%61dmin`\n- Result: Middleware is skipped (no match on `%61dmin`), but controller for `/admin` is executed.\n\nConsequences:\n\n- Authentication Bypass: Unauthenticated users can access protected routes.\n- Authorization Bypass: Restricted administrative endpoints become accessible to lower-privileged users.\n- Input Validation Bypass: Middleware performing sanitization or validation can be skipped.\n\n### Patches\n\nPatched in `@nestjs/platform-fastify@11.1.11`\n\n### Resources\n\nCredit goes to Hacktron AI for reporting this issue.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nestjs/platform-fastify"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "11.1.11"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 11.1.10"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nestjs/nest/security/advisories/GHSA-8wpr-639p-ccrj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-69211"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nestjs/nest/commit/c4cedda15a05aafec1e6045b36b0335ab850e771"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nestjs/nest"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-30T15:32:44Z",
    "nvd_published_at" : "2025-12-29T16:15:44Z"
  }
}