Medium severity · published Mar 23, 2026
CVE-2026-3635
Fastify request.protocol and request.host spoofable via X-Forwarded-Proto/Host from untrusted connections when trustProxy uses restrictive trust function
6.1
CVSS
0.2%
EPSS
No
On KEV
Description
Summary
When trustProxy is configured with a restrictive trust function (e.g., a specific IP like trustProxy: '10.0.0.1', a subnet, a hop count, or a custom function), the request.protocol and request.host getters read X-Forwarded-Proto and X-Forwarded-Host headers from any connection — including connections from untrusted IPs. This allows an attacker connecting directly to Fastify (bypassing the proxy) to spoof both the protocol and host seen by the application.
Affected Versions
fastify <= 5.8.2
Impact
Applications using request.protocol or request.host for security decisions (HTTPS enforcement, secure cookie flags, CSRF origin checks, URL construction, host-based routing) are affected when trustProxy is configured with a restrictive trust function.
When trustProxy: true (trust everything), both host and protocol trust all forwarded headers — this is expected behavior. The vulnerability only manifests with restrictive trust configurations.
CVSS vector
CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
Attack vector
Adjacent
Complexity
High
Privileges
None
User interaction
None
Confidentiality
High
Integrity
None
Availability
None
Scope
Changed
Exploitation
Is it being used?
Exploit prediction (EPSS)0.2% · higher than 5% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
FA
fastify · fastify
through 5.8.2 · source: vendor, NVD
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2026-3635
CVE.org
https://www.cve.org/CVERecord?id=CVE-2026-3635
Third Party Advisory
https://cna.openjsf.org/security-advisories.html
Vendor Advisory
https://github.com/fastify/fastify/security/advisories/GHSA-444r-cwp2-x5xf
Third Party Advisory
https://www.cve.org/CVERecord?id=CVE-2026-3635
More from fastify
8.8
CVE-2022-41919
Fastify is a web framework with minimal overhead and plugin architecture
8.1
CVE-2026-84504
fastify vulnerable to request body replacement via an async validation result collision
7.5
CVE-2026-84428
fastify vulnerable to header validation bypass via incomplete schema case normalization
7.5
CVE-2026-84469
fastify vulnerable to request validation bypass via skipped boolean false schemas
7.5
CVE-2026-76169
fastify vulnerable to authentication bypass via malformed URLs reaching encapsulated not-found handlers
