CVE-2026-84504: fastify vulnerable to request body replacement via an async validation result collision
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.
References
- cna.openjsf.org/security-advisories.html
- github.com/advisories/GHSA-667r-xxjv-c9mm
- github.com/fastify/fastify/commit/f02d8d4ab1ab208f10819c4dc213595b06497833
- github.com/fastify/fastify/releases/tag/v5.12.2
- github.com/fastify/fastify/security/advisories/GHSA-667r-xxjv-c9mm
- nvd.nist.gov/vuln/detail/CVE-2026-84504
Code Behaviors & Features
Detect and mitigate CVE-2026-84504 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →