CVE-2026-18504
MEDIUM 5.3CVSS 3.1fastify vulnerable to schema validation bypass via root primitive coercion mismatch
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.
- Published
- 18 Aug 2026
- Last modified
- 2 Sep 2026
- Assigned by
- ce714d77-add3-4f53-aff5-83d477b104bb
- NVD status
- Analyzed
- Weakness
- CWE-20
- Also known as
- GHSA-w2qp-rph6-63g4
- Sources
- NVDJSONOSV GHSA-w2qp-rph6-63g4JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | ce714d77-add3-4f53-aff5-83d477b104bb (Secondary) | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | fastify | fastifycpe:2.3:a:fastify:fastify:*:*:*:*:*:node.js:*:* |
< 5.12.1 | 5.12.1 |
| OSV | npm | fastify | < 5.12.1 | 5.12.1 |
References
- https://cna.openjsf.org/security-advisories.html · Third Party Advisory, WEB
- https://github.com/fastify/fastify/security/advisories/GHSA-w2qp-rph6-63g4 · Mitigation, Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-18504 · ADVISORY
- https://github.com/fastify/fastify/commit/1ef8a60c87e94f42f666aa15ad68957772a83655 · WEB
- https://github.com/fastify/fastify · PACKAGE
- https://github.com/fastify/fastify/releases/tag/v5.12.1 · WEB
History
- 25 Nov 2026 21:04 UTC · NVD: first stored (published 18 Aug 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 2 Sep 2026)