CVE-2026-3635: fastify Request.protocol And Request.host Spoofable Vulnerability

MODERATE
Advisory Identifier: GHSA-444r-cwp2-x5xf
CVSS 6.1
CWE-348
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-3635
GHSA Identifier GHSA-444r-cwp2-x5xf
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-348: Use of Less Trusted Source
Affected Product fastify
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Adjacent (AV:A)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (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.

fastify fixed: 5.8.3
npm install fastify@5.8.3
Verify Direct and Transitive Dependencies

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

## 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.

CVE-2026-3635 Affected fastify Versions

1 component(s)
Fixed Versions:
5.8.3
Product / Package Ecosystem Affected Versions Fixed Version
fastify
npm
< 5.8.3
5.8.3

References

Frequently Asked Questions

What is CVE-2026-3635?
CVE-2026-3635 is a security vulnerability in fastify involving request.protocol and request.host Spoofable via X-Forwarded-Proto/Host from Untrusted Connections under CWE-348: Use of Less Trusted Source.
Which fastify versions are affected?
Affected versions include releases prior to 5.8.3 across affected packages: fastify.
What version fixes CVE-2026-3635?
Upgrading to 5.8.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fastify affected?
Yes, fastify is affected in releases prior to 5.8.3. Upgrade your dependency to 5.8.3 or later.
What is the CVSS score of CVE-2026-3635?
CVE-2026-3635 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2026-3635?
CVE-2026-3635 is classified under CWE-348: Use of Less Trusted Source (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.).
How can I check npm dependencies for CVE-2026-3635?
Run the dependency tree command: 'npm ls fastify'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}