NestJS
CVE-2025-69211
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend URL-encoded request to protected route (GET /%61dmin)
-
ExploitMiddleware string match fails, security check skipped
-
ExecutionRouter decodes path and invokes protected controller
-
ImpactUnauthenticated 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
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
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.
Primary rating from Vendor (github).
CVSS VectorVendor: github
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Affected Products (CPE)CVE.org
A remote, unauthenticated denial-of-service condition in the NestJS (Nest) microservices framework lets an attacker cras
Denial of service in OpenThread, the open-source Thread networking stack embedded in Google Nest devices (identified as
File Upload vulnerability in nestjs nest v.10.3.2 allows a remote attacker to execute arbitrary code via the Content-Typ
Versions of the package @nestjs/core before 9.0.5 are vulnerable to Information Exposure via the StreamableFile pipe. Ra
A NestJS application using @nestjs/platform-fastify can allow bypass of authentication/authorization middleware when Fas
Remote attackers can crash Nest.js applications (versions prior to 11.1.19) by sending approximately 47 KB of fragmented
NVD
CVE.org
EPSS
GitHub
Exploit-DB