Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. fastify
  4. ›
  5. CVE-2026-18504

CVE-2026-18504: fastify vulnerable to schema validation bypass via root primitive coercion mismatch

September 2, 2026

fastify before 5.12.1, when a route uses a root-level primitive body schema (for example an integer with a minimum and maximum) and the default type coercion, validates the coerced value but exposes the original, uncoerced value to the route handler. For example, a JSON body "10" is coerced to the number 10 and passes an integer 1 to 10 schema, but request.body stays the string "10". An application that trusts the validated type is handed a value that did not satisfy the schema, which can bypass limits the application enforces on that typed value. Object and array body schemas are not affected, they coerce their members in place.

References

  • cna.openjsf.org/security-advisories.html
  • github.com/advisories/GHSA-w2qp-rph6-63g4
  • github.com/fastify/fastify/commit/1ef8a60c87e94f42f666aa15ad68957772a83655
  • github.com/fastify/fastify/releases/tag/v5.12.1
  • github.com/fastify/fastify/security/advisories/GHSA-w2qp-rph6-63g4
  • nvd.nist.gov/vuln/detail/CVE-2026-18504

Code Behaviors & Features

Detect and mitigate CVE-2026-18504 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 →

Affected versions

All versions before 5.12.1

Fixed versions

  • 5.12.1

Solution

Upgrade to version 5.12.1 or above.

Impact 5.4 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-20: Improper Input Validation

Source file

npm/fastify/CVE-2026-18504.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Mon, 07 Sep 2026 12:17:21 +0000.