{"id":"CVE-2026-18504","published":"2026-08-18T20:19:12Z","modified":"2026-08-19T13:15:05Z","title":"fastify vulnerable to schema validation bypass via root primitive coercion mismatch","vendor":"fastify","product":"fastify","tier":"tail","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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.4,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0028,"percentile":0.20992,"provenance":"source"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"https://github.com/fastify/fastify/security/advisories/GHSA-w2qp-rph6-63g4","tags":[]},{"url":"https://cna.openjsf.org/security-advisories.html","tags":[]}],"priority":{"score":13.0,"factors":[{"name":"EPSS percentile","points":4.2},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":3.78}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2026-08-19","earliestUrl":"https://github.com/HORKimhab/CVE-2026-18504-CVE-2026-16732","repos":[{"name":"HORKimhab/CVE-2026-18504-CVE-2026-16732","url":"https://github.com/HORKimhab/CVE-2026-18504-CVE-2026-16732","stars":0,"created":"2026-08-19"}]},"first":{"date":"2026-08-19","source":"PoC-in-GitHub","url":"https://github.com/HORKimhab/CVE-2026-18504-CVE-2026-16732"},"provenance":"source"},"vendorSlug":"fastify","affectedVersions":[{"vendor":"fastify","product":"fastify","versions":["< 5.12.1"]}],"fixedVersions":[{"vendor":"fastify","product":"fastify","versions":["5.12.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-08-19T13:14:53.749588Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"fastify","vulnerableRanges":["<5.12.1"],"patched":["5.12.1"],"from":["GHSA-w2qp-rph6-63g4"],"provenance":"source"}],"summary":{"text":"The flaw is a schema validation bypass in Fastify, the Node.js web framework, affecting versions before 5.12.1 when a request body schema targets a root primitive value. Because Fastify does not replace the original request body with the value Ajv coerced during validation, the route handler receives the unvalidated original string, so an attacker who can reach a vulnerable route with a network request and low privileges can submit a value that fails the schema yet still reaches application logic, potentially undermining integrity or access-control checks that depend on the validated type.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:13:09Z"},"euvd":{"id":"EUVD-2026-61221","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2026-3635","published":"2026-03-23","fixed":"5.8.3","kev":false},{"cve":"CVE-2026-33806","published":"2026-04-15","fixed":"5.8.5","kev":false,"link":{"from":"CVE-2026-33806","to":"CVE-2026-18504","relation":"successor","confidence":"high","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:fastify","fromFixed":"5.8.5","toFixed":"5.12.1","daysApart":125},{"kind":"same-code","provenance":"machine","files":["lib/validation.js"],"commits":["https://github.com/fastify/fastify/commit/1ef8a60c87e94f42f666aa15ad68957772a83655","https://github.com/fastify/fastify/commit/f3d2bcb3963cd570a582e5d39aab01a9ae692fe4"],"basis":"shared file"}]}},{"cve":"CVE-2026-16732","published":"2026-08-18","fixed":"5.12.1","kev":false},{"cve":"CVE-2026-18504","published":"2026-08-18","fixed":"5.12.1","kev":false},{"cve":"CVE-2026-76169","published":"2026-09-04","fixed":"5.12.2","kev":false},{"cve":"CVE-2026-84428","published":"2026-09-04","fixed":"5.12.2","kev":false},{"cve":"CVE-2026-84469","published":"2026-09-04","fixed":"5.12.2","kev":false}],"package":"npm:fastify"}}