CVE-2026-3635: fastify Request.protocol And Request.host Spoofable Vulnerability
MODERATECVE-2026-3635 is a MODERATE (CVSS 6.1) request.protocol and request.host spoofable vulnerability (CWE-348: Use of Less Trusted Source) affecting fastify libraries in the npm ecosystem. The issue involves request.protocol and request.host spoofable via x-forwarded-proto/host from untrusted connections. Remediation is available by upgrading affected packages to version 5.8.3.
CVE-2026-3635 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N).
How to Fix CVE-2026-3635
To remediate this vulnerability, upgrade all affected fastify dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install fastify@5.8.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls fastify
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-3635, inspect your project dependencies using npm:
npm ls fastify
Analyze the terminal output to locate any version of fastify in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.8.3), your application is affected.
Note: The npm ls fastify command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-348: Use of Less Trusted Source, where the product has two different sources of the same data or information, but it uses the source that has less support for verification, is less trusted, or is less resistant to attack. In fastify, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-3635 Affected fastify Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
fastify
|
npm |
< 5.8.3
|
5.8.3
|
References
Frequently Asked Questions
What is CVE-2026-3635?
Which fastify versions are affected?
What version fixes CVE-2026-3635?
Is fastify affected?
What is the CVSS score of CVE-2026-3635?
What CWE is associated with CVE-2026-3635?
How can I check npm dependencies for CVE-2026-3635?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-444r-cwp2-x5xf",
"modified" : "2026-03-25T19:32:28Z",
"published" : "2026-03-25T19:32:28Z",
"aliases" : [ "CVE-2026-3635" ],
"summary" : "fastify: request.protocol and request.host Spoofable via X-Forwarded-Proto/Host from Untrusted Connections",
"details" : "## Summary\n\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\n## Affected Versions\n\nfastify <= 5.8.2\n\n## Impact\n\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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "fastify"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.8.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.8.2"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/fastify/fastify/security/advisories/GHSA-444r-cwp2-x5xf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-3635"
}, {
"type" : "WEB",
"url" : "https://cna.openjsf.org/security-advisories.html"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/fastify/fastify"
}, {
"type" : "WEB",
"url" : "https://github.com/fastify/fastify/releases/tag/v5.8.3"
}, {
"type" : "WEB",
"url" : "https://www.cve.org/CVERecord?id=CVE-2026-3635"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-348" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-25T19:32:28Z",
"nvd_published_at" : "2026-03-23T14:16:34Z"
}
}