CVE-2026-18504
published medium CVSS 3.1 · 5.4fastify vulnerable to schema validation bypass via root primitive coercion mismatch
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| fastify | — | fastify0 to < 5.12.1 (affected · semver) · 5.12.1 (unaffected · semver) · Other versions: unaffected | Version-specific | Not stated | openjs |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 5.4 / 10
- Severity
- medium
- Provider
- openjs · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
- Scenarios
- en: GENERAL
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| fastify | fastify | 0 to < 5.12.1 (affected · semver)5.12.1 (unaffected · semver)Default: unaffected | openjs · cna |
Weaknesses
1- CWE-20 CWE-20: Improper Input Validation
References
2Provider assertions
2openjs · cna
fastify vulnerable to schema validation bypass via root primitive coercion mismatch
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 9cf28f1b0f6306389d1c2d99c03d09def2526e1910531a962f93dd1bf172e150
- Ingested
- 23 Sep 2026, 09:03:19 UTC
- Source record
- Official CVE record