Quick answers
- Is CVE-2026-18504 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-18504 being exploited in the wild.
- How severe is CVE-2026-18504?
- Medium severity, with a CVSS score of 5.4, published 2 September 2026.
- Which products and versions are affected?
- fastify (npm) < 5.12.1, SEMVER:introduced=0,fixed=5.12.1.
- Is there a fix for CVE-2026-18504?
- Yes. fastify (npm): upgrade to 5.12.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2026-18504 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2026-18504?
- Check whether you run fastify (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- fastify (npm): upgrade to 5.12.1 or later
npm install fastify@5.12.1
Technical details
Fastify before 5.12.1 exhibits improper input validation (CWE-20) in its schema validation layer when handling root-level primitive body schemas with default type coercion enabled. The vulnerability stems from a mismatch between validation and data exposure: the framework coerces a value (e.g., string "10" to number 10), validates the coerced value against the schema (e.g., integer 1–10), but then exposes the original uncoerced value (string "10") to the route handler via request.body. An authenticated attacker can send a JSON request body with a primitive type that passes schema validation but whose uncoerced form violates application-enforced constraints. Object and array schemas are unaffected because they perform in-place coercion on their members. The vulnerability requires network access and authentication (PR:L); impact is limited to confidentiality and integrity (C:L/I:L). Fastify 5.12.1 resolves this by ensuring coerced values are exposed to handlers. Workarounds include wrapping primitives in object schemas or re-validating types in the handler.
Affected products
- OpenJS Foundation Fastify < 5.12.1
Identifiers
- CVE-2026-18504
- GHSA-w2qp-rph6-63g4
Timeline
- 2026-08-18: disclosed: Published to National Vulnerability Database
- 2026-09-02: advisory: GitHub Advisory Database published GHSA-w2qp-rph6-63g4
- 2026-09-02: patched: Fastify 5.12.1 released with fix