{"id":"GHSA-444r-cwp2-x5xf","summary":"fastify: request.protocol and request.host Spoofable via X-Forwarded-Proto/Host from Untrusted Connections","details":"## Summary\n\nWhen `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.\n\n## Affected Versions\n\nfastify \u003c= 5.8.2\n\n## Impact\n\nApplications 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.\n\nWhen `trustProxy: true` (trust everything), both `host` and `protocol` trust all forwarded headers — this is expected behavior. The vulnerability only manifests with restrictive trust configurations.","aliases":["CVE-2026-3635"],"modified":"2026-03-25T20:11:28.118992Z","published":"2026-03-25T19:32:28Z","database_specific":{"cwe_ids":["CWE-348"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-03-25T19:32:28Z","nvd_published_at":"2026-03-23T14:16:34Z"},"references":[{"type":"WEB","url":"https://github.com/fastify/fastify/security/advisories/GHSA-444r-cwp2-x5xf"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-3635"},{"type":"WEB","url":"https://cna.openjsf.org/security-advisories.html"},{"type":"PACKAGE","url":"https://github.com/fastify/fastify"},{"type":"WEB","url":"https://github.com/fastify/fastify/releases/tag/v5.8.3"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2026-3635"}],"affected":[{"package":{"name":"fastify","ecosystem":"npm","purl":"pkg:npm/fastify"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"5.8.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-444r-cwp2-x5xf/GHSA-444r-cwp2-x5xf.json","last_known_affected_version_range":"\u003c= 5.8.2"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N"}]}