GHSA-mrhx-c7xc-m3w5 json
Zod can exhaust memory while validating oversized constrained collections
published last mo. modified 19d ago also CVE-2023-54404
- cvss
- 7.5
- version 3.1, GitHub
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- —
- no score, EPSS covers CVEs only
- public exploits
- 0
- none known
Summary
Zod schema-validation library through 4.6.5 contains an uncontrolled resource consumption vulnerability that allows attackers to exhaust memory by submitting a large array to an application using an array schema without a length constraint. Attackers can exploit the handleArrayResult parse logic in $ZodArray, which accumulates every validation issue for each failing element with no cap or early termination, causing the process to allocate excessive issue objects and crash due to out-of-memory conditions.
Patch / fix
- npm zod 4.6.6
- github.com/colinhacks/zod@a0ebf97 commit
- github.com/colinhacks/zod#6475 pull request
- github.com/colinhacks/zod#6652 pull request
Is GHSA-mrhx-c7xc-m3w5 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerCVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| GitHub | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | zod | <4.6.6 |
4.6.6 |
Classification
- Weakness
-
- CWE-770 Allocation of Resources Without Limits or Throttling
References
-
github.com
/colinhacks/zod/pull/6475
web
-
github.com
/colinhacks/zod/pull/6652
web
-
github.com
/colinhacks/zod/commit/a0ebf970f2d752e5f58527cd2942ff48be4f46bd
web
-
nvd.nist.gov
/vuln/detail/CVE-2023-54404
advisory
-
github.com
/colinhacks/zod/issues/1872
web
-
github.com
/colinhacks/zod
package
-
vulncheck.com
/advisories/zod-uncontrolled-resource-consumption-via-array-validation
web
Sources
- GitHub Advisory GHSA-mrhx-c7xc-m3w5
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.