Fastify request.protocol and request.host spoofable via X-Forwarded-Proto/Host from untrusted connections when trustProxy uses restrictive trust function

Summary

CVECVE-2026-3635
StatePUBLISHED
Assigneropenjs
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-03-23 14:16:34 UTC
Updated2026-04-16 17:46:58 UTC
DescriptionSummary 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.

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

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.2 semver Not specified
CNA Fastify Fastify unaffected 5.8.3 semver Not specified

References

ReferenceSourceLinkTags
www.cve.org/CVERecord ce714d77-add3-4f53-aff5-83d477b104bb www.cve.org Third Party Advisory
cna.openjsf.org/security-advisories.html ce714d77-add3-4f53-aff5-83d477b104bb cna.openjsf.org Third Party Advisory
github.com/fastify/fastify/security/advisories/GHSA-444r-cwp2-x5xf ce714d77-add3-4f53-aff5-83d477b104bb github.com Vendor Advisory
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Vendor Comments And Credit

Discovery Credit

CNA: LetaoZhao (TinkAnet) (en)

CNA: KaKa (climba03003) (en)

CNA: Matteo Collina (en)

CNA: Ulises Gascón (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