CVE-2026-18504
Medium · 5.4CVSS
5.4
EPSS
0.3%
Published
Aug 18, 2026
CISA due date
—
Cloudanix analysis
A popular Node.js web framework lets some incorrectly formatted data slip past its safety checks, which can let attackers bypass rules meant to protect the application.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Data Tampering
- Component
- Web Framework
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Low
- Patch risk
- Low
What it actually does
Schema validation bypass for root primitive request bodies: Ajv performs type coercion on incoming JSON strings but Fastify fails to substitute the coerced value, so route handlers receive the original unvalidated string that violates the declared schema.
Why it matters to the business
Applications relying on Fastify for input validation may allow invalid primitive data to reach business logic, undermining access-control and integrity checks and increasing risk of unauthorized actions or data corruption.
How an attack unfolds
An attacker identifies an endpoint whose schema declares a top-level primitive, sends a JSON string that Ajv would coerce into the expected type, and the un-coerced original value reaches the handler where it bypasses intended validation.
How to fix it
Upgrade fastify to version 5.12.1 or later; no workarounds exist.
How to confirm the fix worked
Confirm installed fastify version is at least 5.12.1; test affected endpoints with a root-primitive schema and a string payload that should be rejected to verify validation now fails as expected.
Typical attack path
- Identify route with root-primitive body schema
- Submit JSON string payload that should fail validation
- Bypass occurs because coerced value is not substituted
- Handler processes unvalidated input to trigger logic flaws
How to detect it
Review application logs for requests containing string bodies on routes whose schemas expect root primitives; correlate with any downstream logic that processes values that would have been rejected by the schema.
What your security team should do
- Upgrade fastify to 5.12.1 across all deployments
- Audit schemas that validate root primitive values
- Add regression tests for primitive body validation
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-116654 Tanium addressed an improper input validation vulnerability in Threat Response. CWE-20
- CVE-2026-116653 Tanium addressed an improper input validation vulnerability in Threat Response. CWE-20
- CVE-2026-121240 Improper input validation in Variations in Google Chrome prior to 157.0.8103.38 allowed a… CWE-20
- CVE-2026-121242 Improper input validation in WebPackaging in Google Chrome prior to 157.0.8103.38 allowed… CWE-20
- CVE-2026-121236 Improper input validation in Network in Google Chrome prior to 157.0.8103.38 allowed a… CWE-20
- CVE-2026-121163 Improper input validation in Browser in Google Chrome prior to 157.0.8103.38 allowed a… CWE-20
- CVE-2026-121141 Improper input validation in Editing in Google Chrome prior to 157.0.8103.38 allowed a… CWE-20
- CVE-2026-121115 Improper input validation in Shopping in Google Chrome prior to 157.0.8103.38 allowed a… CWE-20