{"id":"CVE-2026-3635","published":"2026-03-23T13:53:00Z","modified":"2026-03-23T15:30:10Z","title":"Fastify request.protocol and request.host spoofable via X-Forwarded-Proto/Host from untrusted connections when…","vendor":"fastify","product":"fastify","tier":"tail","description":{"text":"Summary\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\nAffected Versions\nfastify <= 5.8.2\n\nImpact\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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.1,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00167,"percentile":0.06078,"provenance":"source"},"cwes":[{"id":"CWE-348","name":"Use of Less Trusted Source"}],"references":[{"url":"https://github.com/fastify/fastify/security/advisories/GHSA-444r-cwp2-x5xf","tags":[]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-3635","tags":[]},{"url":"https://cna.openjsf.org/security-advisories.html","tags":[]}],"priority":{"score":5.5,"factors":[{"name":"EPSS percentile","points":1.22},{"name":"CVSS severity","points":4.27}]},"vendorSlug":"fastify","affectedVersions":[{"vendor":"fastify","product":"fastify","versions":["<= 5.8.2"]}],"fixedVersions":[{"vendor":"fastify","product":"fastify","versions":["5.8.3"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-03-23T15:29:15.532885Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"fastify","vulnerableRanges":["<5.8.3"],"patched":["5.8.3"],"from":["GHSA-444r-cwp2-x5xf"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-14431","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2026-25223","published":"2026-02-03","fixed":"5.7.2","kev":false},{"cve":"CVE-2026-25224","published":"2026-02-03","fixed":"5.7.3","kev":false},{"cve":"CVE-2026-3419","published":"2026-03-06","fixed":"5.8.1","kev":false,"link":{"from":"CVE-2026-3419","to":"CVE-2026-3635","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:fastify","fromFixed":"5.8.1","toFixed":"5.8.3","daysApart":17}]}},{"cve":"CVE-2026-3635","published":"2026-03-23","fixed":"5.8.3","kev":false},{"cve":"CVE-2026-33806","published":"2026-04-15","fixed":"5.8.5","kev":false,"link":{"from":"CVE-2026-3635","to":"CVE-2026-33806","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:fastify","fromFixed":"5.8.3","toFixed":"5.8.5","daysApart":23}]}},{"cve":"CVE-2026-16732","published":"2026-08-18","fixed":"5.12.1","kev":false},{"cve":"CVE-2026-18504","published":"2026-08-18","fixed":"5.12.1","kev":false}],"package":"npm:fastify"}}