GHSA-444r-cwp2-x5xf

Suggest an improvement
Source
https://github.com/advisories/GHSA-444r-cwp2-x5xf
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-444r-cwp2-x5xf/GHSA-444r-cwp2-x5xf.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-444r-cwp2-x5xf
Aliases
  • CVE-2026-3635
Published
2026-03-25T19:32:28Z
Modified
2026-03-25T19:48:38.788319Z
Severity
  • 6.1 (Medium) CVSS_V3 - CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N CVSS Calculator
Summary
fastify: request.protocol and request.host Spoofable via X-Forwarded-Proto/Host from Untrusted Connections
Details

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.

Database specific
{
    "github_reviewed": true,
    "cwe_ids": [
        "CWE-348"
    ],
    "nvd_published_at": "2026-03-23T14:16:34Z",
    "github_reviewed_at": "2026-03-25T19:32:28Z",
    "severity": "MODERATE"
}
References

Affected packages

npm / fastify

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.8.3

Database specific

last_known_affected_version_range
"<= 5.8.2"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-444r-cwp2-x5xf/GHSA-444r-cwp2-x5xf.json"