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

- Severity: Medium 5.4 (CVSS:3.1, scored by openjs) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.29%, higher than 22% of CVEs (2026-12-01)
- Published: 2026-08-18T20:19:12.611Z
- Modified: 2026-09-02T15:31:16.770Z
- Also known as: GHSA-w2qp-rph6-63g4
- Weaknesses: CWE-20
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: 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.

(As written by CVE List.)

## Affected

- fastify fastify: before 5.12.1 (not affected: 5.12.1)
- fastify (npm): before 5.12.1

## Every score

- openjs: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N`
- GitHub: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N`
- NVD: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`

## References

- <https://github.com/fastify/fastify/security/advisories/GHSA-w2qp-rph6-63g4> (mitigation, vendor-advisory, web)
- <https://cna.openjsf.org/security-advisories.html> (third-party-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)

## Sources

- CVE List: [CVE-2026-18504](https://www.cve.org/CVERecord?id=CVE-2026-18504), CVE Terms of Use, modified 2026-08-19
- GitHub Advisory Database: [GHSA-w2qp-rph6-63g4](https://github.com/advisories/GHSA-w2qp-rph6-63g4), CC-BY-4.0, modified 2026-09-02
- NVD: [CVE-2026-18504](https://nvd.nist.gov/vuln/detail/CVE-2026-18504), Public domain, modified 2026-09-02

---

Page: https://cve.day/CVE-2026-18504 · Whole record: https://cve.day/CVE-2026-18504.json · Rebuilt by cve.day 2026-11-25T22:59:33.581Z
