CVE-2026-84469: fastify vulnerable to request validation bypass via skipped boolean false schemas
Impact
Fastify decided whether to validate a request part by checking its schema for JavaScript truthiness. JSON Schema Draft 7 defines the boolean false as a valid schema that rejects every instance, but because false is falsy, a route that set body, querystring, params, or headers to false had that part left uncompiled: no validator was attached and the request reached the handler. An application that used false as a deny-all schema to make a route unreachable was therefore fully bypassed, and an unauthenticated remote client could reach the handler with any input. The same applied to the documented query alias for querystring. This is a complete bypass rather than a weak-schema issue, since false is the strongest JSON Schema assertion and must always fail.
Patches
Request-part schemas are now selected by an explicit presence check rather than truthiness, so a boolean false (or true) schema is compiled and enforced, including through the query alias. Patched in fastify 5.12.2. The fix is also included in the 6.0.0 release.
Workarounds
If upgrading is not immediately possible, express a deny-all request schema with an always-failing object schema instead of the boolean false (for example { "not": {} }), or reject the request in an onRequest hook.
Other sources
fastify versions before 5.12.2 decide whether to compile a request schema based on JavaScript truthiness, but JSON Schema Draft 7 defines the boolean false as a valid schema that rejects every instance. When an application assigns false to a route's body, querystring, params, or headers schema to deny all input, fastify treats it as a missing schema, compiles no validator, and runs the route handler on any request. An unauthenticated remote client can therefore reach a handler that a valid deny-all schema was intended to make unreachable, a complete validation bypass that can lead to unauthorized state changes or execution of disabled operations. Users should upgrade to fastify 5.12.2 or later.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/fastifyto a version that resolves this vulnerability.Fixed in 5.12.2 - Upgrade
Upgrade
fastifyto a version that resolves this vulnerability.Fixed in 5.12.2 - Configuration
If upgrading is not immediately possible, replace the boolean false deny-all schema with an always-failing object schema such as { "not": {} }, or reject the request in an onRequest hook.
Fastify route request validation body, querystring/query, params, or headers schema = {"not":{}}
Event History
Frequently Asked Questions
Which applications are exposed to this bypass?
Applications using fastify versions before 5.12.2 are exposed only where a route assigns the boolean value false as its body, querystring, params, or headers schema. Routes using false as a deny-all schema can receive requests and execute their handlers instead of rejecting all input.
What does an attacker need to exploit it?
An unauthenticated remote client can exploit the issue by sending a request to an affected route. No privileges or user interaction are required.
Are default fastify routes affected?
The issue depends on an application explicitly configuring false for a route request schema component. The provided information does not indicate that routes without such a deny-all schema configuration are affected.
How can I tell whether my application is affected?
Review route definitions for body, querystring, params, or headers schemas set to the boolean value false, and check whether the deployed fastify version is earlier than 5.12.2. Such routes may currently execute their handlers for requests that were intended to be rejected.
What should I do if I cannot upgrade immediately?
The provided remediation is to upgrade to fastify 5.12.2 or later. Until then, identify affected routes and avoid relying on boolean false schemas to prevent their handlers from being reached.