Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. valibot
  4. ›
  5. CVE-2026-59952

CVE-2026-59952: Valibot: record() issue paths can make flatten() throw for inherited Object property names

July 24, 2026

valibot 1.4.1 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.

References

  • github.com/advisories/GHSA-5qjj-4xww-7phc
  • github.com/open-circle/valibot/commit/1bd01c304657cd0809cc92694360b6cc60f700bf
  • github.com/open-circle/valibot/pull/1522
  • github.com/open-circle/valibot/releases/tag/v1.4.2
  • github.com/open-circle/valibot/security/advisories/GHSA-5qjj-4xww-7phc
  • nvd.nist.gov/vuln/detail/CVE-2026-59952

Code Behaviors & Features

Detect and mitigate CVE-2026-59952 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.4.2

Fixed versions

  • 1.4.2

Solution

Upgrade to version 1.4.2 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Learn more about CVSS

Weakness

  • CWE-755: Improper Handling of Exceptional Conditions

Source file

npm/valibot/CVE-2026-59952.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 25 Jul 2026 12:15:50 +0000.