CVE-2026-25223: Fastify's Content-Type header tab character allows body validation bypass

Published Feb 2, 2026
·
Updated

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://hackerone.com/reports/3464114

Other sources

Fastify is a fast and low overhead web framework, for Node.js. Prior to version 5.7.2, 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 issue has been patched in version 5.7.2.

MITRE

Affected Software

2 affected componentsFixes available
npm/fastify<5.7.2
5.7.2
fastify Fastify Node.js<5.7.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/fastify to a version that resolves this vulnerability.

    Fixed in 5.7.2
  2. Upgrade

    Upgrade fastify to a version that resolves this vulnerability.

    Fixed in 5.7.2
  3. Configuration

    If upgrading is not immediately possible, implement a custom Fastify `onRequest` hook that checks `request.headers['content-type']` and rejects the request with HTTP 400 when the header includes a tab character (`'\t'`).

    Fastify (onRequest hook) Content-Type header validation (tab character check) = Reject requests where Content-Type includes '\t'

Event History

Feb 2, 2026
Advisory Published
via GitHub·10:23 PM
Data Sourced
via GitHub·10:23 PM
DescriptionSeverityWeaknessAffected Software
Feb 3, 2026
CVE Published
via MITRE·09:21 PM
Data Sourced
via MITRE·09:21 PM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·10:01 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·10:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:16 PM
RemedyAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-25223?

CVE-2026-25223 is classified as a high-severity vulnerability due to its ability to bypass request body validation.

2

How does CVE-2026-25223 affect application security?

CVE-2026-25223 allows attackers to send malicious payloads by circumventing validation, leading to potential exploitation of the application.

3

What versions of Fastify are affected by CVE-2026-25223?

CVE-2026-25223 affects Fastify versions prior to 5.7.2.

4

How do I fix CVE-2026-25223?

To fix CVE-2026-25223, upgrade Fastify to version 5.7.2 or later.

5

Is there a known exploit for CVE-2026-25223?

Yes, details of the exploit for CVE-2026-25223 have been documented and publicly disclosed.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203