Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate to target fastify API
-
DeliveryIdentify endpoint with root-level primitive body schema
-
ExploitCraft HTTP request body as JSON string instead of expected integer
-
ExecutionSubmit request triggering Ajv coercion without fastify body replacement
-
PersistHandler receives uncoerced string despite passing validation
-
ImpactExploit type mismatch to bypass access-control or integrity check
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
|
| Exploitation Conditions | Exploitation requires authenticated network access (CVSS PR:L confirms low-privilege authentication). The vulnerability is triggered only when a fastify route defines a body schema whose root type is a primitive (e.g., {type: 'integer'}, {type: 'number'}, {type: 'string'} with coercion relevant). Ajv's type coercion must be active, which is the default fastify configuration. The attacker must be able to submit an HTTP request with a JSON body to an endpoint governed by such a schema. Applications using exclusively object or array schemas at the root are not vulnerable to this specific bypass. Exploitation is limited to scenarios where application handlers perform security-sensitive decisions (access control, authorization checks, business rule enforcement) based on the type of request.body without independently re-validating the type inside the handler. No special operating system, cloud platform, or non-default deployment configuration is required beyond a vulnerable fastify version with at least one primitive root schema in active use. |
| Impact | The CVSS 3.1 score of 5.4 (Medium) captures a network-accessible flaw requiring low-privilege authentication, with limited confidentiality and integrity impact and no availability consequence. The AC:L metric reflects that exploitation is mechanically straightforward - no special race condition or environment tuning is needed. No EPSS score was included in the available intelligence, so exploitation probability cannot be quantified beyond the vector. The vulnerability is absent from the CISA KEV catalog and no public proof-of-concept code has been identified, placing this firmly in the category of a medium-priority issue rather than a crisis. That said, the practical risk is non-trivial for any application that uses root-primitive schemas to gate security decisions: even a mid-sized API operation in olsztyn running fastify-backed microservices with integer-typed authorization parameters would face a genuine integrity exposure if those type assumptions are not redundantly enforced inside handlers. The vendor's explicit statement that no workaround exists underscores that upgrading is the only reliable resolution. |
| Exploit ScenarioDerived | An authenticated attacker targeting an API endpoint that accepts a root-level integer body (e.g., a numeric permission tier or resource identifier) submits a JSON string such as '"99"' rather than the bare integer 99. Ajv's coercion causes validation to pass, but fastify delivers the raw string '99' to the route handler. If the handler performs a strict-equality or type-sensitive comparison for authorization - for example, checking whether the submitted value equals a privileged integer constant - the type mismatch may allow the attacker to bypass the check or inject unexpected behavior into downstream business logic. No public proof-of-concept code has been identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 19, 2026
Schema validation bypass in fastify before version 5.12.1 allows authenticated network attackers to submit request bodies that circumvent type enforcement when schemas target root-level primitive values. When Ajv coerces a submitted JSON string to match an expected integer or other primitive type during validation, fastify fails to propagate the coerced value back to the route handler, which instead receives the original unvalidated string. No public exploit code has been identified at time of analysis, but the flaw directly undermines integrity and access-control logic in any application that relies on schema-validated primitive types for authorization or business-rule decisions.
RemediationAI
The vendor-released patch is fastify version 5.12.1, which corrects the mismatch between Ajv's coercion output and the value exposed on request.body in route handlers. Operators should upgrade the fastify npm package to 5.12.1 or later immediately; the fix is documented in GitHub Security Advisory GHSA-w2qp-rph6-63g4 (https://github.com/fastify/fastify/security/advisories/GHSA-w2qp-rph6-63g4) and referenced through the OpenJSF CNA advisory index (https://cna.openjsf.org/security-advisories.html). The vendor has confirmed that no known workarounds are available. Where an immediate upgrade is not feasible, developers should add explicit runtime type checks at the handler level - for example, rejecting requests where typeof request.body does not match the expected primitive type - understanding that this is a defensive code-level measure and not a framework-level fix; it adds maintenance overhead and must be applied consistently across every affected route.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
fastify is a high-performance Node.js web framework that delegates JSON Schema validation to Ajv (Another JSON Validator) as its default engine. Ajv supports type coercion, converting compatible input types (e.g., the JSON string '42' to the integer 42) to satisfy schema constraints. The root cause, classified under CWE-20 (Improper Input Validation), is a synchronization gap between Ajv's coercion result and fastify's post-validation state: when a top-level primitive schema triggers coercion, fastify does not overwrite request.body with the coerced value, so handlers receive the raw pre-coercion string despite validation appearing to succeed. This gap is specific to schemas defining a root-level primitive (e.g., {type: 'integer'}) and does not apply to object or array root schemas. All fastify versions from 0 through less than 5.12.1 are affected, as documented in EUVD-2026-61221 and GitHub Security Advisory GHSA-w2qp-rph6-63g4.
Know when Fastify gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Network-accessible with low-privilege authentication required; limited integrity and confidentiality impact from type-bypass scope with no availability consequence justifies C:L/I:L/A:N.
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
2DescriptionNVD
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.
Blast Radius
ecosystem impact- 69 npm packages depend on fastify (40 direct, 30 indirect)
Ecosystem-wide dependent count for version 5.12.1.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
All versions of @fastify/oauth2 used a statically generated state parameter at startup time and were used across all req
A redirect vulnerability in the `fastify-static` module version >= 4.2.4 and < 4.4.1 allows remote attackers to redirect
Fastify is a fast and low overhead web framework, for Node.js. Rated high severity (CVSS 7.5), this vulnerability is rem
Prototype pollution vulnerability in fastify-multipart < 1.0.5 allows an attacker to crash fastify applications parsing
Fastify node module before 0.38.0 is vulnerable to a denial-of-service attack by sending a request with "Content-Type: a
A denial of service vulnerability exists in Fastify v2.14.1 and v3.0.0-rc.4 that allows a malicious user to trigger reso
A redirect vulnerability in the fastify-static module version < 4.2.4 allows remote attackers to redirect users to arbit
Authorization bypass in the @fastify/express middleware-compatibility plugin (versions 4.0.6 and earlier) lets unauthent
Authentication bypass in @fastify/express v4.0.4 and earlier allows remote unauthenticated attackers to access protected
Middleware bypass in Fastify Express plugin (fastify/express) allows complete circumvention of authentication, authoriza
Fastify is a web framework with minimal overhead and plugin architecture. Rated high severity (CVSS 8.8), this vulnerabi
Authentication and authorization bypass in @fastify/middie (Node.js middleware library for Fastify) allows remote unauth
EUVD-2026-61221
GHSA-w2qp-rph6-63g4
NVD
CVE.org
EPSS
VulDB
Exploit-DB