Skip to main content

NestJS CVE-2025-69211

MEDIUM
Time-of-check Time-of-use (TOCTOU) Race Condition (CWE-367)
2025-12-29 security-advisories@github.com
6.9
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send URL-encoded request to protected route (GET /%61dmin)
  2. Exploit
    Middleware string match fails, security check skipped
  3. Execution
    Router decodes path and invokes protected controller
  4. Impact
    Unauthenticated access to admin/restricted endpoint

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture TOCTOU prevention
Exploitation Conditions

Exploitable only when ALL of the following hold: (1) the application uses @nestjs/platform-fastify (the Fastify adapter, not the default Express adapter); (2) it enforces a security check (authentication/authorization/validation) in a NestMiddleware wired through MiddlewareConsumer, or via app.use(); and (3) that middleware is bound to specific routes using string paths or controllers, e.g. .forRoutes('admin'), rather than being applied globally. Attacker supplies a percent-encoded variant of a character in the path (GET /%61dmin for /admin) so the middleware's literal path match misses while the Fastify router still resolves to the real controller. LIMITING factors: applications on the default Express platform are not affected; middleware applied globally (not path/controller-scoped) is not bypassed; and only versions prior to 11.1.11 are vulnerable. No authentication or user interaction is required for the request itself (PR:N/UI:N).

Impact

This is a genuine but conditional access-control flaw rather than a blanket critical issue. The vendor CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N) indicates a remote, unauthenticated attack with no user interaction, but the AT:P flag (attack requirements present) correctly signals that exploitation depends on a specific, non-default application configuration - not every NestJS deployment is affected. The score of 6.9 (Medium) is consistent with high confidentiality and integrity impact offset by that configuration dependency. The exploit maturity in the vector is E:U (unproven/unreported at the time the vector was authored), yet the intelligence feed marks POC as publicly available because the GHSA advisory itself publishes a working attack request (GET /%61dmin); these two signals conflict, so treat this as 'publicly available exploit code exists' per the advisory rather than relying on the stale E:U metric. No EPSS score was provided and the CVE is NOT listed in CISA KEV, so there is no evidence of active exploitation - absence of KEV combined with a published, trivially reproducible technique means risk is driven by how easy the bug is to weaponize, not by confirmed in-the-wild use. CWE-367 (TOCTOU) accurately captures the root cause: middleware path matching and the router decode URL-encoding at different times. Net: real priority for teams running the vulnerable Fastify-plus-path-based-middleware pattern, lower priority for the Express-default majority.

Exploit ScenarioDerived

An application uses @nestjs/platform-fastify and protects its /admin routes by applying an authentication NestMiddleware via .forRoutes('admin'). An unauthenticated attacker sends GET /%61dmin: the middleware's string match fails against the encoded path so the auth check is skipped, but Fastify's router decodes the path and dispatches to the real /admin controller, granting access. A working proof-of-concept request is published directly in the GHSA-8wpr-639p-ccrj advisory.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 05, 2026

Authentication and authorization bypass in NestJS affects only applications served through the Fastify adapter: @nestjs/platform-fastify versions prior to 11.1.11 fail to execute route-scoped middleware when a request path contains percent-encoded characters, so an unauthenticated remote attacker who requests /%61dmin instead of /admin reaches the protected controller while the middleware that was supposed to guard it is silently skipped. The flaw is conditional - the application must use @nestjs/platform-fastify, must enforce a security check (authentication, authorization, or input validation) inside a NestMiddleware wired through MiddlewareConsumer or app.use(), and must scope that middleware to specific string paths or controllers such as .forRoutes('admin'); globally applied middleware and the default Express platform are not bypassed. Publicly available exploit code exists, and the CVSS 4.0 base score is 6.9 with an independent assessment of CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N (unauthenticated, no user interaction, high confidentiality and integrity impact); there is no indication of confirmed active exploitation (not listed in CISA KEV).

RemediationAI

Vendor-released patch: upgrade @nestjs/platform-fastify to 11.1.11 or later (the fix is delivered in commit c4cedda15a05aafec1e6045b36b0335ab850e771, which pins fastify-plugin 5.1.0 and find-my-way 9.3.0); update the dependency, rebuild, and verified-deploy, then confirm the lockfile resolves to 11.1.11. If an immediate upgrade is not possible, compensating controls are: (1) register security middleware globally rather than with a scoped string path or controller - for example consumer.apply(AuthMiddleware).forRoutes('*') instead of .forRoutes('admin') - which removes the middleware/routing path-matching mismatch entirely, at the cost of running the check on every request (including public and static routes) and possibly requiring explicit exclusions; and (2) move authentication/authorization enforcement out of path-scoped NestMiddleware and into mechanisms that execute after the router has resolved the decoded path, such as Nest Guards or controller-level checks, accepting the refactoring effort and the risk of leaving other path-scoped middleware (sanitization, validation) still bypassable. Note that percent-encoding normalization at a reverse proxy or WAF is not a reliable fix on its own because proxies may decode or forward encoded paths inconsistently and legitimate clients may send encoded characters. Because publicly available exploit code exists, prioritize inventorying which routes are protected only by path-scoped Fastify middleware. Vendor advisory: https://github.com/nestjs/nest/security/advisories/GHSA-8wpr-639p-ccrj; patch commit: https://github.com/nestjs/nest/commit/c4cedda15a05aafec1e6045b36b0335ab850e771.

Affected Packages

npm @nestjs/platform-fastify fix: 11.1.11

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The root cause is CWE-367, a time-of-check/time-of-use mismatch between two different interpretations of the same request path. Nest's MiddlewareConsumer matches a request against the literal path strings supplied to .forRoutes() (for example 'admin'), while the underlying Fastify router (find-my-way) decodes percent-encoded octets before route resolution. A request for /%61dmin therefore fails the middleware's literal 'admin' comparison and the middleware is never invoked, yet the decoded path still resolves to the /admin controller and its handler executes. The result is an access-control decision made on undecoded input while the actual dispatch happens on decoded input, which is why the advisory classifies it as a TOCTOU issue and why it enables authentication bypass, privilege escalation into administrative endpoints, and skipped sanitization or validation. Because the vulnerable component is @nestjs/platform-fastify (npm, Node.js - CPE cpe:2.3:a:nestjs:nest:*:*:*:*:*:node.js:*:*), the flaw is specific to the Fastify integration rather than Nest core; the default Express adapter resolves and matches paths differently and is not affected, and middleware registered globally rather than bound to a string path or controller is not bypassed. The upstream fix commit c4cedda15a05aafec1e6045b36b0335ab850e771 pins fastify-plugin 5.1.0 and find-my-way 9.3.0 and adds an end-to-end regression test (middleware-fastify.spec.ts) that posts to /tests/%69ncluded to verify middleware executes correctly when path characters are percent-encoded, confirming the fix aligns middleware matching with the router's decoded path handling.

Know when Nest gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 6.9 MEDIUM
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
vuln.today AI 7.4 HIGH

Remote unauthenticated request (AV:N/PR:N/UI:N) but AC:H because exploitation requires the specific non-default Fastify plus path-scoped security-middleware configuration; bypass exposes and lets attacker act on protected routes (C:H/I:H), no availability impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
Red Hat 7.4 HIGH

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

Nest is a framework for building scalable Node.js server-side applications. Versions prior to 11.1.11 have a Fastify URL encoding middleware bypass. A NestJS application is vulnerable if it uses @nestjs/platform-fastify; relies on NestMiddleware (via MiddlewareConsumer) for security checks (authentication, authorization, etc.), or through app.use(); and applies middleware to specific routes using string paths or controllers (e.g., .forRoutes('admin')). Exploitation can result in unauthenticated users accessing protected routes, restricted administrative endpoints becoming accessible to lower-privileged users, and/or middleware performing sanitization or validation being skipped. This issue is patched in @nestjs/platform-fastify@11.1.11.

Threat Intelligence Overview

EPSS Score
0.4%
Top 70% exploitable
Prevalence
Medium
popular Node.js framework, but vulnerable Fastify adapter is opt-in minority
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

54
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Affected Products (CPE)CVE.org

cpe:2.3:a:nestjs:nest:*:*:*:*:*:node.js:*:*

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy