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

- Priority: **Routine**
- Reason: Not severe (CVSS 5.4, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-08-18 · Modified: 2026-08-19
- Aliases: GHSA-w2qp-rph6-63g4, CGA-pr3f-jqrw-8g9c, CGA-px89-pw8m-j3gg, CGA-mfpw-hf63-jwc7, CGA-pxmw-jr3w-283g
- Record: https://cvemate.com/vulnerability/CVE-2026-18504 · JSON: https://cvemate.com/vulnerability/CVE-2026-18504/json

## Description

```text
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.
```

## Signals

- CVSS: 5.4 medium (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
- EPSS: 0.287%, percentile 22.821%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- chainguard postgres-meta (Chainguard): All versions (No fix recorded)
- chainguard postgres-meta-fips (Chainguard): All versions (No fix recorded)
- fastify fastify: \< 5.12.1
- Npm fastify (Npm): \< 5.12.1

## References

- <https://github.com/fastify/fastify/security/advisories/GHSA-w2qp-rph6-63g4>
- <https://cna.openjsf.org/security-advisories.html>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-18504>
- <https://github.com/fastify/fastify/commit/1ef8a60c87e94f42f666aa15ad68957772a83655>
- <https://github.com/fastify/fastify>
- <https://github.com/fastify/fastify/releases/tag/v5.12.1>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/18xxx/CVE-2026-18504.json>

---

Data as of 2026-12-05T09:19:47.627Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
