Skip to content
Heist/ feed
HighFix available

fastify vulnerable to request body replacement via an async validation result collision

Type: advisorySource: OSV1 source record

### 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 co

Announced Group revision 1
Original source ↗

GHSA-667r-xxjv-c9mm

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: osv:GHSA-667r-xxjv-c9mm

fastify

Source reference: /affected/0/package/name

Affected versions
Not stated in this record
Fixed versions
5.12.2

Source reference: /affected/0/ranges

Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "ranges": [
      {
        "type": "SEMVER",
        "events": [
          {
            "introduced": "0"
          },
          {
            "fixed": "5.12.2"
          }
        ]
      }
    ],
    "package": {
      "name": "fastify",
      "purl": "pkg:npm/fastify",
      "ecosystem": "npm"
    },
    "database_specific": {
      "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-667r-xxjv-c9mm/GHSA-667r-xxjv-c9mm.json"
    }
  }
]
Related CVEs
CVE-2026-84504

Source reference: /aliases

Publisher severity

high

Source reference: /database_specific/severity

Event
#51909 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement