Skip to main content

fastify CVE-2026-16732

| EUVDEUVD-2026-61222 MEDIUM
Use of Less Trusted Source (CWE-348)
2026-08-18 ce714d77-add3-4f53-aff5-83d477b104bb GHSA-3m5p-2c4r-xxw2
6.1
CVSS 3.1 · Vendor: ce714d77-add3-4f53-aff5-83d477b104bb
View

Attack ChainAIDerived

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

  1. Access
    Identify direct network path to Fastify origin bypassing reverse proxy
  2. Delivery
    Send HTTP request with spoofed X-Forwarded-For and X-Forwarded-Host headers
  3. Exploit
    Hop-count predicate unconditionally satisfies connecting-address guard
  4. Execution
    Fastify trusts and derives host, protocol, and IP from attacker-supplied headers
  5. Impact
    Achieve 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.

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

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

Alert me

AnalysisAIv1 – 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

fastify 5.8.3 <5.12.1

Affected Packages

npm fastify fix: 5.12.1

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

Vendor (ce714d77-add3-4f53-aff5-83d477b104bb) PRIMARY 6.1 MEDIUM
AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
vuln.today AI 6.9 MEDIUM

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.

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

Primary rating from Vendor (ce714d77-add3-4f53-aff5-83d477b104bb).

CVSS VectorVendor: ce714d77-add3-4f53-aff5-83d477b104bb

Attack Vector
Adjacent
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

Lifecycle Timeline

1
Patch available
Aug 18, 2026 - 21:34 EUVD

DescriptionCVE.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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 38 npm packages depend on fastify (13 direct, 25 indirect)

Ecosystem-wide dependent count for version 5.8.3.

Threat Intelligence Overview

EPSS Score
0.1%
Top 96% exploitable
Prevalence
Medium
popular Node.js web framework, widely used but not ubiquitous across all environments
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High

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 No
EPSS 0.1%
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
None
System Exposure· derived
Controlled
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

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

Attack Technique

Cross-Site Request Forgery exploits the automatic credential inclusion behavior of web browsers.

CVE-2023-31999 HIGH POC
8.8 Jul 04

All versions of @fastify/oauth2 used a statically generated state parameter at startup time and were used across all req

CVE-2021-22964 HIGH POC
8.8 Oct 14

A redirect vulnerability in the `fastify-static` module version >= 4.2.4 and < 4.4.1 allows remote attackers to redirect

CVE-2025-32442 HIGH POC
7.5 Apr 18

Fastify is a fast and low overhead web framework, for Node.js. Rated high severity (CVSS 7.5), this vulnerability is rem

CVE-2020-8136 HIGH POC
7.5 Mar 20

Prototype pollution vulnerability in fastify-multipart < 1.0.5 allows an attacker to crash fastify applications parsing

CVE-2018-3711 HIGH POC
7.5 Jun 07

Fastify node module before 0.38.0 is vulnerable to a denial-of-service attack by sending a request with "Content-Type: a

CVE-2020-8192 MEDIUM POC
6.5 Jul 30

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

CVE-2021-22963 MEDIUM POC
6.1 Oct 14

A redirect vulnerability in the fastify-static module version < 4.2.4 allows remote attackers to redirect users to arbit

CVE-2026-6556 CRITICAL
9.1 Jun 30

Authorization bypass in the @fastify/express middleware-compatibility plugin (versions 4.0.6 and earlier) lets unauthent

CVE-2026-33808 CRITICAL
9.1 Apr 15

Authentication bypass in @fastify/express v4.0.4 and earlier allows remote unauthenticated attackers to access protected

CVE-2026-33807 CRITICAL
9.1 Apr 15

Middleware bypass in Fastify Express plugin (fastify/express) allows complete circumvention of authentication, authoriza

CVE-2022-41919 HIGH
8.8 Nov 22

Fastify is a web framework with minimal overhead and plugin architecture. Rated high severity (CVSS 8.8), this vulnerabi

CVE-2026-2880 HIGH
8.2 Feb 27

Authentication and authorization bypass in @fastify/middie (Node.js middleware library for Fastify) allows remote unauth

Vendor StatusVendor

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