Content-Type Header Tab Character Vulnerability in Fastify

fastify Updated 03 Feb 2026

Summary

02/02/2026
HIGH
Yes i
High
7.5

GHSA-jx2c-rxcm-jvmq: Fastify's Content-Type header tab character allows body validation bypass. Affects fastify versions < 5.7.2. Fixed in 5.7.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Fastify is a web framework for Node.js that is designed to be fast and low overhead. It provides a robust set of features for building web applications and APIs, including schema-based validation for request bodies. Fastify's reliance on Content-Type headers for body validation makes it susceptible to certain types of attacks, particularly those that exploit header manipulation.

Vulnerability Detail

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

How To Fix

Latest published version: 5.12.7 as of 22 Oct 2026

npm install fastify@5.12.7

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.7.2

This is the first release that contains the fix.

npm install fastify@5.7.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading is not immediately possible, you can implement a custom 'onRequest' hook to reject requests containing tab characters in the Content-Type header. Here is an example of how to do this in your Fastify application:

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' });
  }
});

Conclusion

The Content-Type header tab character vulnerability in Fastify poses a significant risk to applications relying on body validation through Content-Type headers. Users are strongly encouraged to upgrade to the patched version 5.7.2 or implement the provided workaround to mitigate this risk.

See every vulnerability recorded for fastify →

Share this vulnerability

FAQ

The vulnerability allows attackers to bypass request body validation by manipulating the Content-Type header.

If your application relies on Content-Type for body validation, it may process invalid data, leading to potential security risks.

All versions of Fastify prior to 5.7.2 are affected by this vulnerability.

You can use Vulert to monitor and alert in real-time for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected.

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for fastify.

How To Fix

Latest published version: 5.12.7 as of 22 Oct 2026

npm install fastify@5.12.7

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.7.2

This is the first release that contains the fix.

npm install fastify@5.7.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback