{"cve":"CVE-2026-3635","nvd":{"published":"2026-03-23T14:16:34.720","modified":"2026-06-17T10:43:54.143","status":"Analyzed","description":"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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N","score":6.1},"cwes":["CWE-348"],"references":["https://cna.openjsf.org/security-advisories.html","https://github.com/fastify/fastify/security/advisories/GHSA-444r-cwp2-x5xf","https://www.cve.org/CVERecord?id=CVE-2026-3635"],"products":["fastify:fastify"],"source":"nvd","synced_at":"2026-10-19T22:26:19.218427112+00:00"},"epss":{"cve":"CVE-2026-3635","score":0.00161,"percentile":0.05319,"date":"2026-11-01"},"kev":null,"osv":[{"id":"GHSA-444r-cwp2-x5xf","url":"https://osv.dev/vulnerability/GHSA-444r-cwp2-x5xf","summary":"fastify: request.protocol and request.host Spoofable via X-Forwarded-Proto/Host from Untrusted Connections","modified":"2026-03-25T19:56:21.108110Z","packages":[{"ecosystem":"npm","name":"fastify","purl":"pkg:npm/fastify","ranges":["<5.8.3"],"fixed":["5.8.3"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}