CVE-2026-3635Fastify
Medium 6.1 No auth needed
Follow: this CVE · Fastify · Fastify We alert you by email or Slack (account required).
- Priority
- 52
- CVSS 3.1
- 6.1
- EPSS
- —
- Auth required
- No
- Published
- Mar 23, 2026
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-348
- SSVC (CISA)
- Exploitation: none · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
What happens
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.
What to do
- Apply the vendor's security update for Fastify.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | fastify |
< 5.8.3 |
5.8.3 |
npm install fastify@5.8.3 |
Per OSV / GitHub Advisories (GHSA-444r-cwp2-x5xf). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| fastify | fastify | < 5.8.3 |
Official sources
References
Links published by the sources. Open them with care.
- cna.openjsf.org Third Party Advisory
- github.com Vendor Advisory
- www.cve.org Third Party Advisory