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

- Severity: Medium 6.1 (CVSS:3.1, scored by openjs) `CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.17%, higher than 6% of CVEs (2026-12-02)
- Published: 2026-03-23T13:53:00.386Z
- Modified: 2026-06-17T10:43:54.143Z
- Also known as: GHSA-444r-cwp2-x5xf
- Weaknesses: CWE-348
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: openjs

## Description

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.

(As written by CVE List.)

## Affected

- fastify fastify: up to 5.8.2; before 5.8.3 (not affected: 5.8.3)
- fastify (npm): before 5.8.3

## Every score

- openjs: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N`
- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N`

## References

- <https://github.com/fastify/fastify/security/advisories/GHSA-444r-cwp2-x5xf> (vendor-advisory, web)
- <https://www.cve.org/CVERecord?id=CVE-2026-3635> (third-party-advisory, web)
- <https://cna.openjsf.org/security-advisories.html> (third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-3635> (advisory)
- <https://github.com/fastify/fastify> (package)
- <https://github.com/fastify/fastify/releases/tag/v5.8.3> (web)

## Sources

- CVE List: [CVE-2026-3635](https://www.cve.org/CVERecord?id=CVE-2026-3635), CVE Terms of Use, modified 2026-03-23
- GitHub Advisory Database: [GHSA-444r-cwp2-x5xf](https://github.com/advisories/GHSA-444r-cwp2-x5xf), CC-BY-4.0, modified 2026-03-25
- NVD: [CVE-2026-3635](https://nvd.nist.gov/vuln/detail/CVE-2026-3635), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-3635 · Whole record: https://cve.day/CVE-2026-3635.json · Rebuilt by cve.day 2026-11-25T22:59:16.459Z
