CVE-2026-59952
Received Received - Intake

TypeError in Valibot flatten() Helper with Object Prototype Keys

Vulnerability report for CVE-2026-59952, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-30

Last updated on: 2026-07-30

Assigner: GitHub, Inc.

Description

Valibot helps validate data using a schema. Versions prior to 1.4.2 can throw a TypeError inside its flatten() helper when validation issues contain attacker-controlled object keys such as toString, valueOf, or hasOwnProperty. The issue is reachable through normal record() validation. record() intentionally filters __proto__, prototype, and constructor, but it still accepts other own keys that collide with inherited Object.prototype properties. If the record key schema or value schema rejects such an entry, Valibot creates an issue path containing that key. Passing the resulting issues to Valibot's documented flatten() helper causes flatErrors.nested[dotPath] to resolve to the inherited method instead of an own error array, and the helper calls .push(...) on that function. This is not a global prototype pollution issue. The impact is availability/error handling: applications that validate user-controlled objects with record() and flatten validation errors for API responses can crash the request path with a TypeError instead of returning structured validation errors. This issue has been fixed in version 1.4.2.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-30
Last Modified
2026-07-30
Generated
2026-07-30
AI Q&A
2026-07-30
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
open-circle valibot to 1.4.2 (exc)
open-circle valibot 1.4.2

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-755 The product does not handle or incorrectly handles an exceptional condition.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-59952 affects Valibot versions before 1.4.2. It occurs when validating user-controlled objects with the record() function. If validation issues include keys like toString or valueOf, the flatten() helper crashes with a TypeError because it tries to call .push() on a function instead of an array. This breaks error handling in applications.

Detection Guidance

To detect this vulnerability, check if your Valibot version is prior to 1.4.2. Run: npm list valibot or grep valibot package.json. If the version is below 1.4.2, the system is vulnerable.

Impact Analysis

Applications using Valibot's record() and flatten() for API or form validation may crash when processing attacker-controlled objects. Instead of returning structured errors, the server throws a TypeError, disrupting service availability. This affects error handling workflows but does not lead to data corruption or prototype pollution.

Mitigation Strategies

Upgrade Valibot to version 1.4.2 or later immediately. Update dependencies in package.json and run npm update valibot. If upgrading is not possible, implement input validation to filter keys like toString, valueOf, and hasOwnProperty before validation.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-59952. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart