Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend malformed URL under public plugin prefix
-
DeliveryTrigger not-found router dispatch before URL decoding
-
ExploitShared handler pointer ignores plugin-prefix scoping
-
ExecutionpreHandler auth hook skipped for private plugin
-
PersistPrivate plugin not-found handler invoked unauthenticated
-
ImpactFull protected response returned to attacker
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Alternate path authentication
|
| Exploitation Conditions | Three concurrent conditions must exist in the target application: (1) Fastify version 4.0.0-5.12.1 is in use; (2) the application registers at least two sibling plugins under different prefixes using |
| Impact | The vendor CVSS 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) is assessed as accurate. The attack is network-reachable, requires no authentication or user interaction, and yields full confidentiality loss from the private handler's response. The practical attack surface is narrowed by the required application architecture: both a publicly-accessible plugin prefix and a private sibling plugin with a custom not-found handler whose authentication is implemented exclusively as a preHandler hook must coexist. This is not an exotic configuration - it is precisely the pattern Fastify's documentation promotes for role-separated APIs - so the affected population is non-trivial. No CISA KEV listing and no POC are present in the input data, and EPSS data is absent, so exploitation frequency cannot be quantified. However, the low complexity and zero-privilege requirement mean that once the pattern is known, mass scanning for vulnerable endpoints is straightforward. The fix is a targeted upgrade with no breaking changes noted, making prompt remediation the clear priority rather than workaround-reliance. |
| Exploit ScenarioDerived | An attacker identifies a Fastify application where a private plugin registered under |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 04, 2026
Authentication hook bypass in Fastify 4.0.0-5.12.1 allows unauthenticated network attackers to reach a private plugin's custom not-found handler by sending a malformed URL under a sibling public plugin's prefix. The internal not-found router dispatches malformed paths through a single shared handler pointer before URL decoding, ignoring plugin-prefix scoping and skipping the preHandler lifecycle - the mechanism most Fastify applications use to enforce JWT or session authentication. No public exploit code has been identified at time of analysis, but the AV:N/AC:L/PR:N/UI:N vector means any reachable Fastify deployment meeting the required architecture is exploitable without friction.
RemediationAI
The primary fix is upgrading to Fastify 5.12.2 or later, which corrects the internal not-found router to respect plugin-prefix scoping and invoke the full handler lifecycle - including preHandler hooks - before dispatching 404 responses. The advisory is at https://github.com/fastify/fastify/security/advisories/GHSA-p68q-wchp-6fh7. If immediate upgrade is not feasible, the most effective compensating control is to move authentication logic out of preHandler hooks on not-found handlers and inline it directly inside the setNotFoundHandler callback body, so the check executes regardless of lifecycle bypass. This workaround introduces code duplication and risks auth-logic drift if the hook is later updated without updating the inline copy. A secondary mitigation is to avoid registering sensitive not-found handlers on private scopes when public sibling scopes exist, instead consolidating fallback handling at the application root level. Neither workaround addresses the underlying routing defect.
Affected VersionsENISA
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
Fastify is a high-performance Node.js HTTP framework whose core design feature is encapsulated plugin scoping: each plugin registered via fastify.register() carries its own prefix, lifecycle hooks (including preHandler for authentication), and optionally a custom not-found handler set via setNotFoundHandler(). In versions 4.0.0 through 5.12.1, the internal 404-dispatch code maintains a single shared handler pointer across sibling plugin scopes. When an inbound URL is malformed, the router resolves this shared pointer before URL decoding occurs, bypassing the normal per-scope lifecycle selection. As a result, the preHandler hooks attached to the matched private plugin's not-found handler are never invoked. The root cause class is CWE-288 (Authentication Bypass Using an Alternate Path or Channel): a secondary dispatch path - the pre-decode malformed-URL route - circumvents the primary authentication mechanism. The affected CPE is cpe:2.3:a:fastify:fastify:*:*:*:*:*:*:*:* across the stated range, reported by the OpenJS Foundation CNA.
Know when Fastify 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
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Network-exploitable with no auth and low complexity; impact is confidentiality-only since the attacker reads the protected handler response without modifying application state.
Primary rating from Vendor (openjs).
CVSS VectorVendor: openjs
Lifecycle Timeline
2DescriptionCVE.org
fastify versions >= 4.0.0 and before 5.12.2 can route a malformed URL sent under one plugin prefix to the custom not-found handler of a different sibling plugin, and invoke it without the preHandler hook declared for that handler. The internal not-found router for encapsulated handlers dispatches malformed paths through a single shared handler pointer before URL decoding, ignoring the prefix and skipping the selected handler's normal lifecycle. An unauthenticated attacker can therefore reach an authentication-protected private fallback through an unrelated public prefix and read its full response, bypassing the authentication hook and breaking prefix encapsulation. Users should upgrade to fastify 5.12.2 or later.
Technical POC Analysis
CWE-288: Authentication Bypass Using an Alternate Path or Channel.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Latest POC
1 PoC candidate from github (unverified)
Sign in to open the public PoC links collected for this CVE.
Executive ViewAI
Fastify versions 4.0.0 through 5.12.1 contain an authentication bypass vulnerability allowing unauthenticated attackers to access protected endpoints through malformed URL routing that circumvents authentication hooks. Organizations running affected versions face direct risk of unauthorized access to sensitive application functionality without a vendor patch currently available.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Network segmentation to restrict exposure of affected applications to trusted networks only; (2) Web Application Firewall rules to reject malformed URL requests targeting sibling plugin paths; (3) Enhanced authentication enforcement in plugin preHandler middleware independent of router dispatch; (4) Real-time monitoring and alerting for successful requests reaching private plugin handlers or unexpected 404 patterns.
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.
All versions of @fastify/oauth2 used a statically generated state parameter at startup time and were used across all req
A redirect vulnerability in the `fastify-static` module version >= 4.2.4 and < 4.4.1 allows remote attackers to redirect
Fastify is a fast and low overhead web framework, for Node.js. Rated high severity (CVSS 7.5), this vulnerability is rem
Prototype pollution vulnerability in fastify-multipart < 1.0.5 allows an attacker to crash fastify applications parsing
Fastify node module before 0.38.0 is vulnerable to a denial-of-service attack by sending a request with "Content-Type: a
A denial of service vulnerability exists in Fastify v2.14.1 and v3.0.0-rc.4 that allows a malicious user to trigger reso
A redirect vulnerability in the fastify-static module version < 4.2.4 allows remote attackers to redirect users to arbit
Authorization bypass in the @fastify/express middleware-compatibility plugin (versions 4.0.6 and earlier) lets unauthent
Authentication bypass in @fastify/express v4.0.4 and earlier allows remote unauthenticated attackers to access protected
Middleware bypass in Fastify Express plugin (fastify/express) allows complete circumvention of authentication, authoriza
Fastify is a web framework with minimal overhead and plugin architecture. Rated high severity (CVSS 8.8), this vulnerabi
Authentication and authorization bypass in @fastify/middie (Node.js middleware library for Fastify) allows remote unauth
EUVD-2026-70988
GHSA-p68q-wchp-6fh7
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB