CVE-2026-33806
Content-Type Header Bypass Enables Validation Skip in Fastify Body Schema
Publication date: 2026-04-15
Last updated on: 2026-04-17
Assigner: openjs
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| fastify | fastify | From 5.3.2 (inc) to 5.8.5 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-1287 | The product receives input that is expected to be of a certain type, but it does not validate or incorrectly validates that the input is actually of the expected type. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2026-33806 is a high-severity vulnerability in the Fastify web framework affecting versions >= 5.0.0 and <= 5.3.1, as well as version 4.29.0. It arises from improper parsing of the Content-Type header in HTTP requests.
Specifically, when Fastify applications use schema.body.content to define validation schemas for different content types, an attacker can bypass the intended request body validation by manipulating the Content-Type header. For example, by prepending a space or altering casing in the Content-Type string (e.g., ' application/json' or 'Application/JSON'), the schema validation is skipped even though the body is still parsed correctly.
This means that the application may accept and process malformed or malicious data without proper validation, potentially leading to unauthorized data modification.
How can this vulnerability impact me? :
This vulnerability allows attackers to bypass request body validation in Fastify applications that use per-content-type validation schemas. As a result, attackers can send malicious or malformed data that the application will accept without proper checks.
The impact is primarily on data integrity, as unauthorized modification of data is possible. The CVSS v3.1 score rates this as a high-severity issue with an integrity impact but no confidentiality or availability impact.
Because the attack vector is network-based and requires no privileges or user interaction, it can be exploited remotely and easily.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by monitoring HTTP requests to Fastify applications for suspicious Content-Type headers that include leading spaces or variations in casing or whitespace before semicolons. Such malformed Content-Type headers may indicate attempts to bypass schema validation.
To detect this on your system or network, you can capture and inspect HTTP request headers for Content-Type anomalies.
- Use packet capture tools like tcpdump or Wireshark to filter HTTP traffic and look for Content-Type headers with leading spaces or unusual formatting.
- Example tcpdump command to capture HTTP traffic on port 80: sudo tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | grep -i 'Content-Type'
- Use curl or similar HTTP clients to test your Fastify endpoints by sending requests with manipulated Content-Type headers, for example: curl -X POST -H 'Content-Type: application/json' -d '{"foo":"bar"}' http://your-fastify-app/
If your application accepts requests with such headers and the schema validation is bypassed, it indicates the vulnerability is present.
What immediate steps should I take to mitigate this vulnerability?
The immediate and recommended mitigation step is to upgrade Fastify to version 5.8.5 or later, where this vulnerability has been fully patched.
There are no effective workarounds other than upgrading, as the vulnerability arises from how Fastify parses the Content-Type header internally.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
This vulnerability allows attackers to bypass request body validation in Fastify applications by manipulating the Content-Type header, which can lead to unauthorized modification of data (integrity impact).
Such unauthorized data modification could potentially affect compliance with standards and regulations like GDPR and HIPAA, which require ensuring data integrity and protecting against unauthorized data alteration.
However, the provided information does not explicitly discuss or analyze the direct impact of this vulnerability on compliance with these or other common standards and regulations.