Incorrect Behavior Order: Early Validation Affecting fastify package, versions <5.12.2


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.39% (32nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-FASTIFY-19639040
  • published7 Sept 2026
  • disclosed4 Sept 2026
  • creditvelgusgus599

Introduced: 4 Sep 2026

NewCVE-2026-84504  (opens in a new tab)
CWE-179  (opens in a new tab)

How to fix?

Upgrade fastify to version 5.12.2 or higher.

Overview

fastify is an overhead web framework, for Node.js.

Affected versions of this package are vulnerable to Incorrect Behavior Order: Early Validation through the request validation path in lib/validation.js. An attacker can replace the validated request body, or trigger a validation failure, by sending an $async schema-validated payload that includes attacker-controlled value or error properties. When a route uses an asynchronous request schema, Fastify processes the resolved validator result before the handler runs and can pass the handler a different body than the one that satisfied the schema. This can lead to unauthorized state changes or data disclosure in applications that trust the validated request body for business logic.

Workarounds

  • Avoid $async request schemas.
  • 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 throw or reject on failure instead of returning an { error } object.

CVSS Base Scores

version 4.0
version 3.1