Skip to content
Heist/ feed
Back to feed
Medium

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

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-59952
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 21:17 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 30 Jul 2026, 00:10 UTC

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.

osv:CVE-2026-59952
Complete source record
{
  "id": "f90f9a37337902f4cbdfb6254288d40ac3922627dc34416f53a1aee839ed9c14",
  "url": "https://osv.dev/vulnerability/CVE-2026-59952",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Valibot: record() issue paths can make flatten() throw for inherited Object property names",
    "summary": "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.",
    "evidence": "osv:CVE-2026-59952",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-59952",
      "aliases": [
        "CVE-2026-59952",
        "GHSA-5qjj-4xww-7phc"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/open-circle/valibot",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "0dc26ea88cf07a414653375f0da43f97e0eed607"
                },
                {
                  "fixed": "1bd01c304657cd0809cc92694360b6cc60f700bf"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.4.2"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "1bd01c304657cd0809cc92694360b6cc60f700bf"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "0dc26ea88cf07a414653375f0da43f97e0eed607"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v1.4.2"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v1.7.1-to-json-schema",
            "v1.4.1",
            "v1.7.0-to-json-schema",
            "v1.2.0-i18n",
            "v1.4.0",
            "v1.3.1",
            "v1.1.0-i18n",
            "v1.6.0-to-json-schema",
            "v1.3.0",
            "v1.5.0-to-json-schema",
            "v0.1.2-zod-to-valibot",
            "v0.1.1-zod-to-valibot",
            "v0.1.0-zod-to-valibot",
            "v1.4.0-to-json-schema",
            "v1.2.0",
            "v1.3.0-to-json-schema",
            "v1.2.0-to-json-schema",
            "v1.1.0-to-json-schema",
            "v1.1.0",
            "v1.0.0-to-json-schema",
            "v1.0.0-i18n",
            "v1.0.0",
            "v1.0.0-rc.4",
            "v1.0.0-rc.3",
            "v1.0.0-rc.2",
            "v1.0.0-rc.1",
            "v1.0.0-rc.0-to-json-schema",
            "v1.0.0-rc.0-i18n",
            "v1.0.0-rc.0",
            "v1.0.0-beta.15",
            "v1.0.0-beta.14",
            "v1.0.0-beta.5-to-json-schema",
            "v1.0.0-beta.13",
            "v1.0.0-beta.12",
            "v1.0.0-beta.4-to-json-schema",
            "v1.0.0-beta.11",
            "v1.0.0-beta.10",
            "v1.0.0-beta.2-i18n",
            "v1.0.0-beta.9",
            "v1.0.0-beta.8",
            "v1.0.0-beta.7",
            "v1.0.0-beta.6",
            "v1.0.0-beta.3-to-json-schema",
            "v1.0.0-beta.5",
            "v1.0.0-beta.4",
            "v1.0.0-beta.1-i18n",
            "v1.0.0-beta.2-to-json-schema",
            "v1.0.0-beta.1-to-json-schema",
            "v1.0.0-beta.3",
            "v1.0.0-beta.2",
            "v1.0.0-beta.1",
            "v1.0.0-beta.0-i18n",
            "1.0.0-beta.0-to-json-schema",
            "v1.0.0-beta.0",
            "v0.2.1-to-json-schema",
            "v0.42.1",
            "v0.2.0-to-json-schema",
            "v0.42.0",
            "v0.1.1-to-json-schema",
            "v0.1.0-to-json-schema",
            "v0.41.0",
            "v0.40.0",
            "v0.39.0",
            "v0.38.0",
            "v0.37.0",
            "v0.36.0",
            "v0.35.0",
            "v0.34.0",
            "v0.33.3",
            "v0.33.2",
            "v0.33.1",
            "v0.33.0",
            "v0.32.0",
            "v0.31.1",
            "v0.31.0",
            "v0.31.0-rc.12",
            "v0.31.0-rc.11",
            "v0.31.0-rc.10",
            "v0.31.0-rc.9",
            "v0.31.0-rc.8",
            "v0.31.0-rc.7",
            "v0.31.0-rc.6",
            "v0.31.0-rc.5",
            "v0.31.0-rc.4",
            "v0.31.0-rc.3",
            "v0.31.0-rc.2",
            "v0.31.0-rc.1",
            "v0.30.0",
            "v0.29.0",
            "v0.28.1",
            "v0.28.0",
            "v0.27.1",
            "v0.27.0",
            "v0.26.0",
            "v0.25.0",
            "v0.24.1",
            "v0.24.0",
            "v0.23.0",
            "v0.22.0",
            "v0.21.0",
            "v0.20.1",
            "v0.20.0",
            "v0.19.0",
            "v0.18.0",
            "v0.17.1",
            "v0.17.0",
            "v0.16.0",
            "v0.15.0",
            "v0.14.0",
            "v0.13.1",
            "v0.13.0",
            "v0.12.0",
            "v0.11.1",
            "v0.11.0",
            "v0.10.0",
            "v0.9.0",
            "v0.8.0",
            "v0.7.0",
            "v0.6.0",
            "v0.5.0",
            "v0.4.0",
            "v0.3.0",
            "v0.2.1",
            "v0.2.0",
            "v0.1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-59952.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:23.530654176Z",
      "provider": "osv",
      "references": [
        "https://github.com/open-circle/valibot/releases/tag/v1.4.2",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59952.json",
        "https://github.com/open-circle/valibot/security/advisories/GHSA-5qjj-4xww-7phc",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-59952",
        "https://github.com/open-circle/valibot/commit/1bd01c304657cd0809cc92694360b6cc60f700bf",
        "https://github.com/open-circle/valibot/pull/1522"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-755"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59952.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-59952",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 490164,
  "published_at": "2026-07-30T00:10:32.598+00:00"
}