Skip to main content

fastify EUVDEUVD-2026-61221

| CVE-2026-18504 MEDIUM
Improper Input Validation (CWE-20)
2026-08-18 ce714d77-add3-4f53-aff5-83d477b104bb GHSA-w2qp-rph6-63g4
5.3
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate to target fastify API
  2. Delivery
    Identify endpoint with root-level primitive body schema
  3. Exploit
    Craft HTTP request body as JSON string instead of expected integer
  4. Execution
    Submit request triggering Ajv coercion without fastify body replacement
  5. Persist
    Handler receives uncoerced string despite passing validation
  6. Impact
    Exploit 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

fastify 0 <5.12.1

Affected Packages

npm fastify fix: 5.12.1

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

NVD PRIMARY 5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
vuln.today AI 5.4 MEDIUM

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.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
Red Hat 5.4 MEDIUM

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

Lifecycle Timeline

2
CVSS changed
Sep 02, 2026 - 14:37 NVD
5.4 (MEDIUM) 5.3 (MEDIUM)
Patch available
Aug 18, 2026 - 21:34 EUVD

DescriptionNVD

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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 69 npm packages depend on fastify (40 direct, 30 indirect)

Ecosystem-wide dependent count for version 5.12.1.

Threat Intelligence Overview

EPSS Score
0.3%
Top 76% exploitable
Prevalence
Medium
popular Node.js web framework, common in microservices and APIs
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS GHSA Vendor GitHub VulDB

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

CVE-2023-31999 HIGH POC
8.8 Jul 04

All versions of @fastify/oauth2 used a statically generated state parameter at startup time and were used across all req

CVE-2021-22964 HIGH POC
8.8 Oct 14

A redirect vulnerability in the `fastify-static` module version >= 4.2.4 and < 4.4.1 allows remote attackers to redirect

CVE-2025-32442 HIGH POC
7.5 Apr 18

Fastify is a fast and low overhead web framework, for Node.js. Rated high severity (CVSS 7.5), this vulnerability is rem

CVE-2020-8136 HIGH POC
7.5 Mar 20

Prototype pollution vulnerability in fastify-multipart < 1.0.5 allows an attacker to crash fastify applications parsing

CVE-2018-3711 HIGH POC
7.5 Jun 07

Fastify node module before 0.38.0 is vulnerable to a denial-of-service attack by sending a request with "Content-Type: a

CVE-2020-8192 MEDIUM POC
6.5 Jul 30

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

CVE-2021-22963 MEDIUM POC
6.1 Oct 14

A redirect vulnerability in the fastify-static module version < 4.2.4 allows remote attackers to redirect users to arbit

CVE-2026-6556 CRITICAL
9.1 Jun 30

Authorization bypass in the @fastify/express middleware-compatibility plugin (versions 4.0.6 and earlier) lets unauthent

CVE-2026-33808 CRITICAL
9.1 Apr 15

Authentication bypass in @fastify/express v4.0.4 and earlier allows remote unauthenticated attackers to access protected

CVE-2026-33807 CRITICAL
9.1 Apr 15

Middleware bypass in Fastify Express plugin (fastify/express) allows complete circumvention of authentication, authoriza

CVE-2022-41919 HIGH
8.8 Nov 22

Fastify is a web framework with minimal overhead and plugin architecture. Rated high severity (CVSS 8.8), this vulnerabi

CVE-2026-2880 HIGH
8.2 Feb 27

Authentication and authorization bypass in @fastify/middie (Node.js middleware library for Fastify) allows remote unauth

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy