CVE-2026-84504: fastify vulnerable to request body replacement via an async validation result collision

Published Sep 4, 2026
·
Updated

Impact

Fastify runs a route's validator and, for a result shaped like { value, error }, unwraps it: an error becomes a validation failure and value replaces the request part. This convention is intended for synchronous custom compilers (for example Joi). A JSON Schema $async validator, however, resolves with the validated data itself, so Fastify applied the same unwrapping to it. If a request part validated by an $async schema contains a value property, Fastify replaced the whole request part with that nested value before the handler ran, so a value or error property in the payload was attacker-controlled. An application that dispatches operations from the validated request body could then act on data that never satisfied the route schema, leading to unauthorized state changes or disclosure. Reaching the vulnerable path requires the route to use an $async request schema.

Patches

Fastify no longer treats an asynchronous validation result as a { value, error } wrapper: an async validator's resolved value is used only to determine pass or fail, and it can no longer replace the request part or inject an error. The synchronous custom-compiler contract is unchanged. Patched in fastify 5.12.2 and 6.0.0.

Workarounds

If upgrading is not immediately possible, avoid $async request schemas, or perform the security-sensitive check in an onRequest or preHandler hook rather than relying on the schema-validated request part. Custom async validator compilers should signal failure by throwing (rejecting) rather than returning an { error } object.

Other sources

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.

— MITRE

Affected Software

3 affected componentsFixes available
fastify/fastify<5.12.2
fastify Fastify Node.js<5.12.2
npm/fastify<5.12.2
5.12.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.12.2
  2. Upgrade

    Upgrade fastify to a version that resolves this vulnerability.

    Fixed in 5.12.2
  3. Compensating control

    If upgrading is not immediately possible, avoid using $async request schemas, or perform security-sensitive checks in an onRequest or preHandler hook instead of relying on the schema-validated request part.

Event History

Sep 4, 2026
CVE Published
via MITRE·09:40 AM
Data Sourced
via MITRE·09:40 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:17 AM
DescriptionSeverityWeaknessAffected Software
Sep 30, 2026
Advisory Published
via GitHub·11:45 PM
Data Sourced
via GitHub·11:45 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

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.

2

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.

3

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.

4

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.

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