CVE-2026-16732
fastify vulnerable to X-Forwarded-* spoofing under trustProxy hop-count
Also known as GHSA-3m5p-2c4r-xxw2
Mitigation
- Upgrade fastify to 5.12.1 or later.
Who should check
- Projects that depend on npm package fastify (>= 5.8.3, < 5.12.1)
- Anyone running fastify >= 5.8.3, < 5.12.1
Vulnerability facts
- Affected
- fastify >= 5.8.3, < 5.12.1
- Fixed in
- 5.12.1
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 6.1 (v3.1, CNA)CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Adjacent network
- Attack complexity: High
- Privileges required: None
- User interaction: None
- Scope: Changed (impact reaches other components)
- Confidentiality impact: High
- Integrity impact: None
- Availability impact: None
- EPSS
- 0.16% chance of exploitation in 30 days (percentile 3, 2026-11-26)
- CWE
- CWE-348
- Modified
Description
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.
Affected and fixed versions
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-16732. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-16732.md Affected: fastify >= 5.8.3, < 5.12.1 Fixed in: 5.12.1 Steps: 1. Search this machine and project for fastify (npm), fastify: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
FAQ
Is CVE-2026-16732 being exploited?
There is no confirmed exploitation: CVE-2026-16732 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.16% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-16732?
Medium: CVSS 6.1 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2026-16732?
fastify >= 5.8.3, < 5.12.1.
Is there a fix for CVE-2026-16732?
Yes. Fixed in 5.12.1. Upgrade fastify to 5.12.1 or later.
How do I check if I'm affected by CVE-2026-16732?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.