CVE-2026-3419: Fastify Fastify's Missing End Anchor Vulnerability

MODERATE
Advisory Identifier: GHSA-573f-x89g-hqp9
CVSS 5.3
CWE-185
Published
Advisory Summary

CVE-2026-3419 is a MODERATE (CVSS 5.3) fastify's missing end anchor vulnerability (CWE-185: Incorrect Regular Expression) affecting Fastify libraries in the npm ecosystem. The issue involves fastify's missing end anchor in "subtypenamereg" allows malformed content-types to pass validation. Remediation is available by upgrading affected packages to version 5.8.1.

CVE-2026-3419 at a Glance

CVE Identifier CVE-2026-3419
GHSA Identifier GHSA-573f-x89g-hqp9
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-185: Incorrect Regular Expression
Affected Product Fastify
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-3419

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.1
npm install fastify@5.8.1
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-3419, 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.1), 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-185: Incorrect Regular Expression, where the product specifies a regular expression in a way that causes data to be improperly matched or compared. 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

# Description Fastify incorrectly accepts malformed `Content-Type` headers containing trailing characters after the subtype token, in violation of [RFC 9110 §8.3.1](https://httpwg.org/specs/rfc9110.html#field.content-type). For example, a request sent with `Content-Type: application/json garbage` passes validation and is processed normally, rather than being rejected with `415 Unsupported Media Type`. When regex-based content-type parsers are in use (a documented Fastify feature), the malformed value is matched against registered parsers using the full string including the trailing garbage. This means a request with an invalid content-type may be routed to and processed by a parser it should never have reached. ## Impact An attacker can send requests with RFC-invalid `Content-Type` headers that bypass validity checks, reach content-type parser matching, and be processed by the server. Requests that should be rejected at the validation stage are instead handled as if the content-type were valid. ## Workarounds Deploy a WAF rule to protect against this ## Fix The fix is available starting with v5.8.1.

CVE-2026-3419 Affected Fastify Versions

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

References

Frequently Asked Questions

What is CVE-2026-3419?
CVE-2026-3419 is a security vulnerability in Fastify involving Fastify's Missing End Anchor in "subtypeNameReg" Allows Malformed Content-Types to Pass Validation under CWE-185: Incorrect Regular Expression.
Which Fastify versions are affected?
Affected versions include releases prior to 5.8.1 across affected packages: fastify.
What version fixes CVE-2026-3419?
Upgrading to 5.8.1 (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.1. Upgrade your dependency to 5.8.1 or later.
What is the CVSS score of CVE-2026-3419?
CVE-2026-3419 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2026-3419?
CVE-2026-3419 is classified under CWE-185: Incorrect Regular Expression (The product specifies a regular expression in a way that causes data to be improperly matched or compared.).
How can I check npm dependencies for CVE-2026-3419?
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-573f-x89g-hqp9",
  "modified" : "2026-03-06T22:44:34Z",
  "published" : "2026-03-05T21:29:54Z",
  "aliases" : [ "CVE-2026-3419" ],
  "summary" : "Fastify's Missing End Anchor in \"subtypeNameReg\" Allows Malformed Content-Types to Pass Validation",
  "details" : "# Description\n\nFastify incorrectly accepts malformed `Content-Type` headers containing trailing characters after the subtype token, in violation of [RFC 9110 §8.3.1](https://httpwg.org/specs/rfc9110.html#field.content-type). For example, a request sent with `Content-Type: application/json garbage` passes validation and is processed normally, rather than being rejected with `415 Unsupported Media Type`.\n\nWhen regex-based content-type parsers are in use (a documented Fastify feature), the malformed value is matched against registered parsers using the full string including the trailing garbage. This means a request with an invalid content-type may be routed to and processed by a parser it should never have reached.\n\n## Impact\n\nAn attacker can send requests with RFC-invalid `Content-Type` headers that bypass validity checks, reach content-type parser matching, and be processed by the server. Requests that should be rejected at the validation stage are instead handled as if the content-type were valid.\n\n## Workarounds\n\nDeploy a WAF rule to protect against this\n\n## Fix\n\nThe fix is available starting with v5.8.1.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "fastify"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.7.2"
      }, {
        "fixed" : "5.8.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.8.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify/security/advisories/GHSA-573f-x89g-hqp9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-3419"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify/commit/67f6c9b32cb3623d3c9470cc17ed830dd2f083d7"
  }, {
    "type" : "WEB",
    "url" : "https://cna.openjsf.org/security-advisories.html"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-573f-x89g-hqp9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/fastify/fastify"
  }, {
    "type" : "WEB",
    "url" : "https://httpwg.org/specs/rfc9110.html#field.content-type"
  }, {
    "type" : "WEB",
    "url" : "https://www.cve.org/CVERecord?id=CVE-2026-3419"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-185" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-05T21:29:54Z",
    "nvd_published_at" : "2026-03-06T18:16:22Z"
  }
}