CVE-2026-33806: Fastify Body Schema Validation Bypass via Leading Space in Content-Type Header

fastify Updated 15 Apr 2026

Summary

15/04/2026
Yes i
High
7.5

CVE-2026-33806: Fastify has a Body Schema Validation Bypass via Leading Space in Content-Type Header. Affects fastify versions >= 5.3.2, < 5.8.5. Fixed in 5.8.5. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

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. This framework is widely used for its performance and ease of use, but it has a vulnerability that can compromise data integrity when validating request bodies.

Vulnerability Detail

A validation bypass vulnerability exists in Fastify v5.x where request body validation schemas specified via schema.body.content can be completely circumvented by prepending a single space character to the Content-Type header. This issue arises from a regression introduced by a commit that altered how the Content-Type header is processed, leading to a parser-validator differential. The vulnerability allows attackers to bypass all body validation by simply adding a leading space, which can have serious implications for data integrity and security in applications relying on Fastify for validation.

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

This is the first release that contains the fix.

npm install fastify@5.8.5

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

Workaround

As a temporary workaround, you can modify the getEssenceMediaType function in the validation.js file to include trimStart() before the split operation. Here is the modified code:

function getEssenceMediaType(header) {
  if (!header) return '';
  return header.trimStart().split(/[ ;]/, 1)[0].trim().toLowerCase();
}

Conclusion

The CVE-2026-33806 vulnerability in Fastify poses a significant risk by allowing attackers to bypass body schema validation through a simple modification of the Content-Type header. It is crucial for developers using Fastify to update to the patched version and consider implementing the recommended workaround until they can upgrade.

See every vulnerability recorded for fastify →

Share this vulnerability

FAQ

CVE-2026-33806 is a vulnerability in Fastify that allows for body schema validation to be bypassed by adding a leading space in the Content-Type header.

If your application relies on Fastify for validating request bodies, this vulnerability can allow attackers to send invalid data without triggering validation errors.

Fastify versions 5.3.2 to 5.8.4 are affected by this vulnerability. Version 5.8.5 and later contain the fix.

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

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

This is the first release that contains the fix.

npm install fastify@5.8.5

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