CVE-2026-25223: Fastify Fastify's Content-Type Header Tab Character Vulnerability

HIGH
Advisory Identifier: GHSA-jx2c-rxcm-jvmq
CVSS 7.5
CWE-436
Published
Advisory Summary

CVE-2026-25223 is a HIGH (CVSS 7.5) fastify's content-type header tab character vulnerability (CWE-436: Interpretation Conflict) affecting Fastify libraries in the npm ecosystem. The issue involves fastify's content-type header tab character allows body validation bypass. Remediation is available by upgrading affected packages to version 5.7.2.

CVE-2026-25223 at a Glance

CVE Identifier CVE-2026-25223
GHSA Identifier GHSA-jx2c-rxcm-jvmq
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-436: Interpretation Conflict
Affected Product Fastify
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:H/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 High (I:H)
Availability None (A:N)

How to Fix CVE-2026-25223

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.7.2
npm install fastify@5.7.2
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-25223, 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.7.2), 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-436: Interpretation Conflict, where product a handles inputs or steps differently than product b, which causes a to perform incorrect actions based on its perception of b's state. 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

### Impact A validation bypass vulnerability exists in Fastify where request body validation schemas specified by Content-Type can be completely circumvented. By appending a tab character (`\t`) followed by arbitrary content to the Content-Type header, attackers can bypass body validation while the server still processes the body as the original content type. For example, a request with `Content-Type: application/json\ta` will bypass JSON schema validation but still be parsed as JSON. This vulnerability affects all Fastify users who rely on Content-Type-based body validation schemas to enforce data integrity or security constraints. The concrete impact depends on the handler implementation and the level of trust placed in the validated request body, but at the library level, this allows complete bypass of body validation for any handler using Content-Type-discriminated schemas. This issue is a regression or missed edge case from the fix for a previously reported vulnerability. ### Patches This vulnerability has been patched in **Fastify v5.7.2**. All users should upgrade to this version or later immediately. ### Workarounds If upgrading is not immediately possible, user can implement a custom `onRequest` hook to reject requests containing tab characters in the Content-Type header: ```javascript fastify.addHook('onRequest', async (request, reply) => { const contentType = request.headers['content-type'] if (contentType && contentType.includes('\t')) { reply.code(400).send({ error: 'Invalid Content-Type header' }) } }) ``` ### Resources - https://github.com/fastify/fastify/blob/759e9787b5669abf953068e42a17bffba7521348/lib/validation.js#L272 - https://github.com/fastify/fastify/blob/759e9787b5669abf953068e42a17bffba7521348/lib/content-type-parser.js#L125 - [Fastify Validation and Serialization Documentation](https://fastify.dev/docs/latest/Reference/Validation-and-Serialization/) - https://hackerone.com/reports/3464114

CVE-2026-25223 Affected Fastify Versions

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

References

Frequently Asked Questions

What is CVE-2026-25223?
CVE-2026-25223 is a security vulnerability in Fastify involving Fastify's Content-Type header tab character allows body validation bypass under CWE-436: Interpretation Conflict.
Which Fastify versions are affected?
Affected versions include releases prior to 5.7.2 across affected packages: fastify.
What version fixes CVE-2026-25223?
Upgrading to 5.7.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fastify affected?
Yes, fastify is affected in releases prior to 5.7.2. Upgrade your dependency to 5.7.2 or later.
What is the CVSS score of CVE-2026-25223?
CVE-2026-25223 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-25223?
CVE-2026-25223 is classified under CWE-436: Interpretation Conflict (Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.).
How can I check npm dependencies for CVE-2026-25223?
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-jx2c-rxcm-jvmq",
  "modified" : "2026-02-04T17:46:02Z",
  "published" : "2026-02-02T22:23:29Z",
  "aliases" : [ "CVE-2026-25223" ],
  "summary" : "Fastify's Content-Type header tab character allows body validation bypass",
  "details" : "### Impact\n\nA validation bypass vulnerability exists in Fastify where request body validation schemas specified by Content-Type can be completely circumvented. By appending a tab character (`\\t`) followed by arbitrary content to the Content-Type header, attackers can bypass body validation while the server still processes the body as the original content type.\n\nFor example, a request with `Content-Type: application/json\\ta` will bypass JSON schema validation but still be parsed as JSON.\n\nThis vulnerability affects all Fastify users who rely on Content-Type-based body validation schemas to enforce data integrity or security constraints. The concrete impact depends on the handler implementation and the level of trust placed in the validated request body, but at the library level, this allows complete bypass of body validation for any handler using Content-Type-discriminated schemas.\n\nThis issue is a regression or missed edge case from the fix for a previously reported vulnerability.\n\n### Patches\n\nThis vulnerability has been patched in **Fastify v5.7.2**. All users should upgrade to this version or later immediately.\n\n### Workarounds\n\nIf upgrading is not immediately possible, user can implement a custom `onRequest` hook to reject requests containing tab characters in the Content-Type header:\n\n```javascript\nfastify.addHook('onRequest', async (request, reply) => {\n  const contentType = request.headers['content-type']\n  if (contentType && contentType.includes('\\t')) {\n    reply.code(400).send({ error: 'Invalid Content-Type header' })\n  }\n})\n```\n\n### Resources\n\n- https://github.com/fastify/fastify/blob/759e9787b5669abf953068e42a17bffba7521348/lib/validation.js#L272\n- https://github.com/fastify/fastify/blob/759e9787b5669abf953068e42a17bffba7521348/lib/content-type-parser.js#L125\n- [Fastify Validation and Serialization Documentation](https://fastify.dev/docs/latest/Reference/Validation-and-Serialization/)\n- https://hackerone.com/reports/3464114",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "fastify"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.7.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify/security/advisories/GHSA-jx2c-rxcm-jvmq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-25223"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify/commit/32d7b6add39ddf082d92579a58bea7018c5ac821"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/3464114"
  }, {
    "type" : "WEB",
    "url" : "https://fastify.dev/docs/latest/Reference/Validation-and-Serialization"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/fastify/fastify"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify/blob/759e9787b5669abf953068e42a17bffba7521348/lib/content-type-parser.js#L125"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify/blob/759e9787b5669abf953068e42a17bffba7521348/lib/validation.js#L272"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-436" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-02T22:23:29Z",
    "nvd_published_at" : "2026-02-03T22:16:31Z"
  }
}