CVE-2026-84504: fastify vulnerable to request body replacement via an async validation result collision
fastify versions before 5.12.2 treat the object resolved by a successful Ajv async validator as the value result protocol used by custom validator compilers. If a request that passes its route schema contains a property named value at the root, fastify replaces the entire request body with that property's value before the handler runs, so the handler receives a different object than the one that satisfied the schema. An authenticated low-privilege caller can use this to make nested data replace the validated body and trigger an operation the route schema did not authorize, leading to unauthorized state changes and data disclosure. Users should upgrade to fastify 5.12.2 or later.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
fastifyto a version that resolves this vulnerability.Fixed in 5.12.2
Event History
Frequently Asked Questions
Which deployments are exposed?
Fastify deployments running versions before 5.12.2 are affected when they use Ajv async validation for a route. Exploitation also depends on a route accepting a request body whose root can contain a property named value.
What does an attacker need to exploit this issue?
The attacker needs network access and low-privilege authenticated access. They must submit a request that passes the route schema and includes a root-level value property whose nested data becomes the body seen by the handler.
Is there a configuration workaround if upgrading is delayed?
The provided information identifies upgrading to Fastify 5.12.2 or later as the remediation. It does not specify a supported configuration workaround.
How can I assess whether an application may be affected?
Check whether the application uses Fastify before 5.12.2 and routes with Ajv async validators. Review whether those routes accept root-level value properties and whether handlers could act on replacement nested data that was not authorized by the route schema.