CVE-2026-3635
March 23, 2026
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.
Affected Packages
fastify (NPM):
Affected version(s) >=0.0.1 <5.8.3Fix Suggestion:
Update to version 5.8.3fastify (NPM):
Affected version(s) >=0.0.1 <5.8.3Fix Suggestion:
Update to version 5.8.3fastify (NPM):
Affected version(s) >=0.0.1 <5.8.3Fix Suggestion:
Update to version 5.8.3fastify (NPM):
Affected version(s) >=0.0.1 <5.8.3Fix Suggestion:
Update to version 5.8.3fastify (NPM):
Affected version(s) >=0.0.1 <5.8.3Fix Suggestion:
Update to version 5.8.3Related Resources (6)
Do you need more information?
Contact UsCVSS v4
Base Score:
7
Attack Vector
ADJACENT
Attack Complexity
HIGH
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
NONE
Vulnerable System Availability
NONE
Subsequent System Confidentiality
HIGH
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
6.1
Attack Vector
ADJACENT
Attack Complexity
HIGH
Privileges Required
NONE
User Interaction
NONE
Scope
CHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
NONE
Weakness Type (CWE)
Use of Less Trusted Source
EPSS
Base Score:
0.01