CVE-2026-18504: fastify vulnerable to schema validation bypass via root primitive coercion mismatch
Vulnerability summary
CVE-2026-18504 is a medium (CVSS 5.4) Improper Input Validation vulnerability in fastify. EPSS estimates a 0.29% chance of exploitation in the next 30 days, higher than 22.8% of scored vulnerabilities.
Not severe (CVSS 5.4, network access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Timeline
- 18-08-2026PublishedVulnerability first disclosed.
- 19-08-2026Last modifiedVulnerability information updated.
Description
fastify is a fast and low overhead web framework for Node.js. Versions of fastify before 5.12.1 are affected by a schema validation bypass when a request body schema targets a root primitive value. When the schema validates a top-level primitive such as an integer, Ajv can coerce a JSON string into the expected type during validation, but Fastify does not replace the root request body with the coerced value, so the route handler receives the original unvalidated string. As a result, a request that should have failed validation can reach application logic with a value that does not satisfy the schema, which can undermine integrity and access-control checks that rely on the validated type. Users should upgrade to fastify 5.12.1, which fixes the mismatch. No known workarounds are available.
CVSS metrics
4 scores · 4 sources · 1 version- OSV · NpmEcosystem advisory · calculated5.4MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
- NVDNIST5.3MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:NDiffers
- OSV · ChainguardEcosystem advisory · calculated5.4MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
EPSS trend
Probability
0.29%
Chance of exploitation in the next 30 days
Percentile
23%
Versus all other CVEs
30-day change
Increase +0.01 pp
From 0.28% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, low-privilege account, no user interaction (CVSS vector). Other conditions: not stated in public data.
Chainguard2 products
- postgres-metaAll versions (No fix recorded)
- postgres-meta-fipsAll versions (No fix recorded)
Fastify1 product
- fastify< 5.12.1
Npm1 product
- fastify< 5.12.1
3 vendors · 4 products
References
7 links- github.com/fastify/fastify/security/advisories/GHSA-w2qp-rph6-63g4WEBMitigationVendor AdvisoryAdvisory
- github.com/fastify/fastifyPACKAGE