Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify direct network path to Fastify origin bypassing reverse proxy
-
DeliverySend HTTP request with spoofed X-Forwarded-For and X-Forwarded-Host headers
-
ExploitHop-count predicate unconditionally satisfies connecting-address guard
-
ExecutionFastify trusts and derives host, protocol, and IP from attacker-supplied headers
-
ImpactAchieve host injection, CSRF-origin bypass, or secure-cookie spoofing against the application
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V6 - Authentication IP-independent access control
|
| Exploitation Conditions | Exploitation requires two specific conditions to align simultaneously: the target application must be configured with a numeric trustProxy value (any positive integer such as trustProxy: 1, 2, or higher), and the attacker must be able to establish a direct TCP connection to the Fastify origin server, bypassing the front-facing reverse proxy. Applications using trustProxy set to an IP address string, CIDR block, or custom validation function are not affected by this regression. No authentication, user interaction, or elevated privilege is required on the attacker's part - only network reachability to the origin. The principal factor limiting exploitation in practice is network isolation: if the origin server is properly confined behind the proxy with no direct external or internal access path, the attack surface is substantially reduced even without an application-level fix. Fastify versions prior to 5.8.3 (before the incomplete CVE-2026-3635 patch was introduced) and versions 5.12.1 and later (where the numeric form is disabled) are not affected. |
| Impact | The official CVSS 6.1 score (AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N) reflects an adjacent-network, high-complexity attack with changed scope and high confidentiality impact. The adjacent vector assumes the Fastify origin is isolated from direct internet access, which is the primary real-world constraint on exploitability; if the origin is reachable from the internet without network-level controls, the effective attack complexity drops substantially. No EPSS score was supplied in the source data, and this vulnerability is not currently listed in the CISA KEV catalog; no public exploit code has been identified. The moderate CVSS score may understate operational risk for applications that use the derived IP, host, or protocol values in security-sensitive decisions - CSRF validation, secure-cookie scope enforcement, HTTPS-redirect logic, and host-based routing are all affected impact classes explicitly named in the advisory. Even a mid-sized municipal IT team in bytom running a fastify-backed API gateway behind a load balancer with trustProxy: 1 should treat this as an urgent configuration review, since the regression specifically affects the most common single-proxy numeric setting. The vulnerability is compounded by its nature as an incomplete fix: teams who applied the CVE-2026-3635 patch may incorrectly believe they are fully remediated, making discovery through routine scanning less likely. |
| Exploit ScenarioDerived | An attacker determines that a target's Fastify origin server is directly reachable - for example, via an exposed port in a misconfigured cloud security group or an internal network route that bypasses the reverse proxy - and confirms from a public source or reconnaissance that the application uses a numeric trustProxy setting. The attacker sends an HTTP request directly to the origin with a crafted X-Forwarded-For header containing a trusted IP and a spoofed X-Forwarded-Host header pointing to an attacker-controlled domain; because the hop-count predicate unconditionally satisfies the trust guard, fastify accepts these values and derives host, protocol, and IP from attacker-supplied data. The attacker then exploits the injected host value to poison host-based cache entries, forge CSRF-origin checks, suppress HTTPS enforcement, or redirect generated URLs to an attacker-controlled endpoint. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 19, 2026
Header spoofing in fastify 5.8.3 through 5.12.0 persists despite the prior CVE-2026-3635 patch because the numeric trustProxy form compiles to a hop-count predicate that structurally ignores the connecting address, rendering the guard introduced by the earlier fix completely ineffective for this configuration. An attacker who can reach the Fastify origin server directly - bypassing the front-facing reverse proxy - can forge X-Forwarded-For, X-Forwarded-Host, and related fields that fastify uses to derive request.ip, request.hostname, request.host, and request.protocol, enabling host injection in generated URLs, HTTPS-enforcement bypass, secure-cookie and CSRF-origin spoofing, and host-based routing and cache poisoning. No public exploit has been identified at time of analysis; the vendor-released fix is fastify 5.12.1, which disables the numeric trustProxy form entirely.
RemediationAI
The primary fix is to upgrade to fastify 5.12.1, which disables the numeric trustProxy form at runtime and removes it from the TypeScript type union, eliminating the vulnerable predicate entirely. The vendor advisory is available at https://github.com/fastify/fastify/security/advisories/GHSA-3m5p-2c4r-xxw2. If an immediate upgrade is not feasible, the vendor-recommended workaround is to replace any numeric trustProxy value with an equivalent IP address, CIDR range, or custom function that explicitly validates the connecting address - for example, replacing trustProxy: 1 with the IP or CIDR of the known proxy. As a complementary network-level control, enforce firewall or network-policy rules that block direct external access to the Fastify origin server, ensuring all traffic transits through the trusted proxy chain; this limits exposure even if the configuration issue remains temporarily in place, though it should not be treated as a substitute for the application-level fix. Note that disabling forwarded-header trust entirely (trustProxy: false) is the most conservative option but will break client-IP and protocol detection for legitimate use cases.
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, low-overhead web framework for Node.js (no CPE string was provided in source data; affected version range 5.8.3 to 5.12.1 is confirmed by EUVD-2026-61222 and the vendor advisory GHSA-3m5p-2c4r-xxw2). The root cause maps to CWE-348 (Use of Less Trusted Source): fastify's trustProxy configuration controls which incoming connections are permitted to supply forwarded headers that override the apparent request host, protocol, and client IP. The fix for CVE-2026-3635 added a guard that checks the connecting address before accepting these headers, which works correctly when trustProxy is an IP address, CIDR block, or custom validation function - those forms compile to predicates that inspect the actual connecting peer. However, when trustProxy is set to a positive integer (e.g., 1 to indicate a single reverse proxy hop), the compiled predicate only counts forwarded hops and completely ignores the connecting address. The guard therefore evaluates to true for every request containing at least one forwarded hop, regardless of where the TCP connection originates. Application code and security middleware that consumes the derived host, protocol, and IP values from fastify is therefore exposed to attacker-controlled input on any path where the origin server is directly reachable.
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:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
Attacker must bypass the proxy and reach the adjacent origin (AV:A/AC:H); CSRF-origin and secure-cookie bypass introduce partial integrity impact (I:L) beyond the official I:N.
Primary rating from Vendor (ce714d77-add3-4f53-aff5-83d477b104bb).
CVSS VectorVendor: ce714d77-add3-4f53-aff5-83d477b104bb
Lifecycle Timeline
1DescriptionCVE.org
fastify is a fast and low overhead web framework for Node.js. Impact: the fix for CVE-2026-3635 added a guard on the forwarded-header reads used to derive the request host, protocol, hostname, ip, and ips values, checking the connecting address. That guard closes the IP, CIDR, and custom-function forms of trustProxy correctly, because those forms compile to predicates that inspect the connecting address. The hop-count form, where trustProxy is set to a number, compiles to a predicate that structurally ignores the address, so the guard is always satisfied for any hop count of one or more. Applications configured with a numeric trustProxy value, such as trustProxy set to 1 for a single reverse proxy, remain vulnerable: an attacker who can reach the Fastify origin directly, bypassing the front-facing proxy, can spoof the forwarded request fields exactly as in the unpatched version. The impact class matches the parent CVE-2026-3635, including host injection in generated URLs, HTTPS-enforcement bypass, secure-cookie and CSRF-origin bypass, and host-based routing and cache poisoning. Affected versions are fastify from 5.8.3 up to but not including 5.12.1. Patches: patched in fastify 5.12.1, where the numeric form of trustProxy is disabled at runtime and removed from the TypeScript type union. Workarounds: migrate to an IP, CIDR, or custom-function trustProxy value that validates the connecting address, and ensure the Fastify origin is only reachable through the trusted proxy chain.
Blast Radius
ecosystem impact- 38 npm packages depend on fastify (13 direct, 25 indirect)
Ecosystem-wide dependent count for version 5.8.3.
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
Cross-Site Request Forgery exploits the automatic credential inclusion behavior of web browsers.
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-61222
GHSA-3m5p-2c4r-xxw2
NVD
CVE.org
EPSS
Exploit-DB