fastify vulnerable to X-Forwarded-* spoofing under trustProxy hop-count

Summary

CVECVE-2026-16732
StatePUBLISHED
Assigneropenjs
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-08-18 21:16:34 UTC
Updated2026-09-02 14:39:20 UTC
Descriptionfastify 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.

Risk And Classification

Primary CVSS: v3.1 6.1 MEDIUM from ce714d77-add3-4f53-aff5-83d477b104bb

CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N

EPSS: 0.001440000 probability, percentile 0.039600000 (date 2026-09-02)

Problem Types: CWE-348 | CWE-348 CWE-348: Use of Less Trusted Source


VersionSourceTypeScoreSeverityVector
3.1ce714d77-add3-4f53-aff5-83d477b104bbSecondary6.1MEDIUMCVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
3.1CNACVSS6.1MEDIUMCVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N

CVSS v3.1 Breakdown

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

CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N

NVD Known Affected Configurations (CPE 2.3)

TypeVendorProductVersionUpdateEditionLanguage
Application Fastify Fastify All All All All

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Fastify Fastify affected 5.8.3 5.12.1 semver Not specified
CNA Fastify Fastify unaffected 5.12.1 semver Not specified

References

ReferenceSourceLinkTags
cna.openjsf.org/security-advisories.html ce714d77-add3-4f53-aff5-83d477b104bb cna.openjsf.org Third Party Advisory
github.com/fastify/fastify/security/advisories/GHSA-3m5p-2c4r-xxw2 ce714d77-add3-4f53-aff5-83d477b104bb github.com Mitigation, Vendor Advisory
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Vendor Comments And Credit

Discovery Credit

CNA: alimony (en)

CNA: mcollina (en)

CNA: climba03003 (en)

CNA: UlisesGascon (en)

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report