GHSA-jx2c-rxcm-jvmq

Suggest an improvement
Source
https://github.com/advisories/GHSA-jx2c-rxcm-jvmq
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-jx2c-rxcm-jvmq/GHSA-jx2c-rxcm-jvmq.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-jx2c-rxcm-jvmq
Aliases
Published
2026-02-02T22:23:29Z
Modified
2026-02-04T18:07:32.787861Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N CVSS Calculator
Summary
Fastify's Content-Type header tab character allows body validation bypass
Details

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:

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://hackerone.com/reports/3464114
Database specific
{
    "cwe_ids": [
        "CWE-436"
    ],
    "github_reviewed_at": "2026-02-02T22:23:29Z",
    "nvd_published_at": "2026-02-03T22:16:31Z",
    "severity": "HIGH",
    "github_reviewed": true
}
References

Affected packages

npm / fastify

Package

Affected ranges

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

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-jx2c-rxcm-jvmq/GHSA-jx2c-rxcm-jvmq.json"