Fastify patches Content-Type whitespace schema validation bypass
TL;DR — Fastify’s per-content-type body validation can be skipped by sending a Content-Type header with a leading space, letting requests reach handlers without expected schema enforcement.
What happened
Fastify is a high-performance Node.js web framework commonly used for API backends where request schema validation is part of the application’s security and data-integrity posture.
CVE-2026-33806 describes a body schema validation bypass affecting Fastify apps that use schema.body.content for per-content-type validation: prepending a space to the Content-Type header causes schema validation to be skipped, even though the request body is still parsed correctly. The CVE notes this behavior is a regression introduced in fastify >= 5.3.2 as part of the fix for CVE-2025-32442.
| Item | Source value |
|---|---|
| Weakness | CWE-1287 (Improper Validation of Specified Type of Input) |
| Severity | CVSS v3.1 7.5 (High) |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Why this matters: header parsing/canonicalization edge cases routinely turn into “silent security control drop” failures (validation, auth, routing). If you rely on schema validation to enforce invariants before business logic (including downstream SQL/ORM assumptions), this is a high-leverage bypass primitive. (raw.githubusercontent.com)
Who is impacted
- Applications using
fastifyand relying onschema.body.contentfor per-content-type body validation. fastifyversions>= 5.3.2and< 5.8.5(per the CVE affected version range). (raw.githubusercontent.com)
What to do now
- Follow vendor remediation guidance and apply a release that includes the fix.
"Upgrade to fastify v5.8.5 or later." (raw.githubusercontent.com)
- Treat this as a validation control failure: inventory services using
schema.body.content, and add regression tests forContent-Typenormalization/whitespace handling in your edge stack (LB/WAF/proxies) and in application-level request handling. - If you cannot patch immediately, note the CVE’s workaround guidance:
"None. Upgrade to the patched version." (raw.githubusercontent.com)
Content is AI-assisted and reviewed by our team, but issues may be missed and best practices evolve rapidly, send corrections to [email protected]. Always consult official documentation and validate key implementation decisions before making design or security choices.
