CVE-2023-54404
Zod can exhaust memory while validating oversized constrained collections
Description
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.
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » zodvia npm zod | < 4.6.6 | 4.6.6 |
| org.webjars.npm » zodvia npm zod | < 4.6.6 | 4.6.6 |
Blast radius
21% of the dependent artifacts (9) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 238 |
| 2 hops | 76 |
| 3 hops | 31 |
Most used dependents
- org.mvnpm.at.scalar » types13 usages
- org.mvnpm.at.scalar » openapi-types9 usages
- org.webjars.npm » scalar__openapi-types9 usages
- org.webjars.npm » scalar__themes8 usages
- org.webjars.npm » scalar__types8 usages
- org.mvnpm.at.scalar » themes8 usages
- org.mvnpm.at.scalar » workspace-store8 usages
- org.mvnpm.at.scalar » openapi-parser7 usages
- org.webjars.npm » scalar__components6 usages
- org.mvnpm.at.scalar » components6 usages
- org.mvnpm.at.scalar » use-hooks6 usages
- org.webjars.npm » scalar__workspace-store6 usages
- org.mvnpm.at.reown » appkit-controllers5 usages
- org.mvnpm.at.reown » appkit-wallet5 usages
- org.webjars.npm » scalar__oas-utils5 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) . See all on OSV
References
| Advisory | NVD CVE-2023-54404 | nvd.nist.gov |
| Package | colinhacks/zod | github.com |
| Web | colinhacks/zod issue #1872 | github.com |
| Web | colinhacks/zod pull request #6475 | github.com |
| Web | colinhacks/zod pull request #6652 | github.com |
| Web | colinhacks/zod commit a0ebf97 | github.com |
| Web | advisories/zod-uncontrolled-resource-consumption-via-array-validation | vulncheck.com |
