Vulnerability advisory

CVE-2023-54404

Zod Uncontrolled Resource Consumption via Unbounded Array, Set, and Map Validation

Published Updated OSV record ↗

Also known as GHSA-mrhx-c7xc-m3w5

Severity
  • CVSS 4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Affected versions

Repository

Affected commitsFixed by commit
GIT github.com/colinhacks/zod ↗
All commits through b500a2ee95134f81d74da7911d7378dd2853d042No fix listed
Also listed as affected (203)
  • v4.6.7
  • v4.6.5
  • v4.6.4
  • v4.6.3
  • v4.6.2
  • v4.6.1
  • v4.6.0
  • v4.5.4
  • v4.5.3
  • v4.5.2
  • v4.5.1
  • v4.5.0
  • v4.4.3
  • v4.4.2
  • v4.4.1
  • v4.4.0
  • v4.3.6
  • v4.3.5
  • v4.3.4
  • v4.3.3
  • v4.3.2
  • v4.3.1
  • v4.3.0
  • v4.2.1
  • v4.2.0
  • v4.1.13
  • v4.1.12
  • v4.1.11
  • v4.1.10
  • v4.1.9
  • v4.1.8
  • v4.1.7
  • v4.1.5
  • v4.1.4
  • v4.1.3
  • v4.1.2
  • v4.1.1
  • v4.1.0
  • v4.0.17
  • v4.0.16
  • v4.0.15
  • v4.0.14
  • v4.0.13
  • v4.0.12
  • v4.0.11
  • v4.0.10
  • v4.0.9
  • v4.0.8
  • v4.0.7
  • v4.0.6
  • v3.25.71
  • v4.0.5
  • v4.0.4
  • v3.25
  • v4.0.3
  • v4.0.1
  • v3.25.76
  • v3.25.75
  • v3.25.74
  • v3.25.73
  • v3.25.72
  • v3.25.70
  • v3.25.69
  • v3.25.68
  • v3.25.67
  • v3.25.66
  • v3.25.65
  • v3.25.64
  • v3.25.63
  • v3.25.62
  • v3.25.61
  • v3.25.60
  • v3.25.59
  • v3.25.58
  • v3.25.57
  • v3.25.56
  • v3.25.55
  • v3.25.54
  • v3.25.53
  • v3.25.52
  • v3.25.51
  • v3.25.50
  • v3.25.49
  • v3.25.48
  • v3.25.47
  • v3.25.46
  • v3.25.45
  • v3.25.44
  • v3.25.43
  • v3.25.42
  • v3.25.41
  • v3.25.40
  • v3.25.39
  • v3.25.38
  • v3.25.37
  • v3.25.36
  • v3.25.35
  • v3.25.34
  • v3.25.33
  • v3.25.32
  • v3.25.31
  • v3.25.30
  • v3.25.29
  • v3.25.28
  • v3.25.27
  • v3.25.26
  • v3.25.25
  • v3.25.24
  • v3.25.23
  • v3.25.22
  • v3.25.21
  • v3.25.20
  • v3.25.18
  • v3.25.17
  • v3.25.16
  • v3.25.15
  • v3.25.14
  • v3.25.13
  • v3.25.12
  • v3.25.11
  • v3.25.10
  • v3.25.9
  • v3.24.4
  • v3.24.3
  • v3.24.2
  • v3.24.1
  • v3.24.0
  • v3.23.8
  • v3.23.7
  • v3.23.6
  • v3.23.5
  • v3.23.4
  • v3.23.3
  • v3.23.2
  • v3.23.1
  • v3.23.0
  • v3.23.0-beta.0
  • v3.22.4
  • v3.22.3
  • v3.22.2
  • v3.22.1
  • v3.22.0
  • v3.21.4
  • v3.21.3
  • v3.21.2
  • v3.21.1
  • v3.21.0
  • v3.20.6
  • v3.20.5
  • v3.20.4
  • v3.20.3
  • v3.20.2
  • v3.20.1
  • v3.20
  • v3.20.0
  • v3.19.1
  • v3.19.0
  • v3.18.0
  • v3.17.10
  • v3.17.9
  • v3.17.8
  • v3.17.7
  • v3.17.6
  • v3.17.5
  • v3.17.4
  • v3.17.3
  • v3.17.2
  • v3.17.0
  • v3.16.1
  • v3.16.0
  • v3.15.1
  • v3.15.0
  • v3.14.5
  • v3.14.4
  • v3.14.3
  • v3.14.2
  • v3.14.1
  • v3.14.0
  • v3.13.4
  • v3.13.2
  • v3.12.0
  • v3.11.6
  • v3.11.4
  • v3.11.3
  • v3.10.3
  • v3.9.0
  • v3.8.0
  • v3.7.3
  • v3.5.0
  • v3.4.2
  • v3.4.0
  • v3.2
  • v3.1.0
  • v3.0.0
  • v3.0.0-alpha.18
  • 1.10.2
  • v1.9
  • v1.8
  • 1.7
  • v1.0
  • v1.2.0
  • v1.1.2
  • 1.0

Description

Zod schema-validation library contains an uncontrolled resource consumption vulnerability that allows attackers to exhaust memory by submitting a large array, set or map to an application that uses a container schema without an explicit size constraint. The handleArrayResult parse logic in $ZodArray (and the equivalent set and map paths) accumulates every validation issue for each failing element with no cap or early termination, causing the process to allocate one issue object per element and crash under out-of-memory conditions. This is reachable in the default configuration whenever a container schema such as z.array() is declared without a size bound. The upstream change in commit e06a510 (pull request 6652, first released in 4.6.6) only moves the .max(), .length() and .size() size checks to run before element parsing, so it rejects oversized input for schemas that declare an explicit upper bound; per the maintainer, unbounded containers are unchanged. No released version remediates the unbounded (default) case described here, and an opt-in setting to cap total accumulated errors was proposed but not merged.

References

  • Codex
  • Claude Code
  • VS Code
  • GitHub Copilot
  • Cursor
  • Cline
  • Windsurf
  • Google Anti-gravity
  • OpenCode
  • Pi
  • Gemini CLI
  • Hermes Agent
  • Zed
  • Junie
  • Qwen Code
  • Kiro
  • Kilo Code
  • Factory Droid

Set up GitHits for your agents

Run this command:

<> bash
npx githits@latest init

What happens next:

  1. Opens your browser to authorize GitHits
  2. Asks whether to set up GitHits at the user or project level
  3. Detects your supported AI coding tools
  4. Lets you choose which tools to configure
  5. Configures the selected tools