Quick answers
- Is CVE-2023-4316 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2023-4316 being exploited in the wild.
- How severe is CVE-2023-4316?
- Low severity, with a CVSS score of 3.1, published 28 September 2023.
- Which products and versions are affected?
- Zod SEMVER:introduced=0,fixed=3.22.3.
- Is there a fix for CVE-2023-4316?
- Yes. Zod: upgrade to 3.22.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2023-4316 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2023-4316?
- Check whether you run Zod at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- Zod: upgrade to 3.22.3 or later
Technical details
The vulnerability is a ReDoS (Regular Expression Denial of Service) flaw in the email validation regex pattern. The complex email regex contains nested quantifiers that cause catastrophic backtracking when processing certain input patterns, leading to exponential time complexity. An unauthenticated network attacker can trigger the vulnerability by submitting a specially crafted email string to any application using Zod's z.string().email() validator, causing the validation to hang and consume CPU resources. The vulnerability affects Zod versions up to 3.22.2 and was fixed in version 3.22.3 by replacing the vulnerable regex with a safer implementation.
Affected products
- Colinhacks Zod up to 3.22.2
Identifiers
- CVE-2023-4316
- GHSA-m95q-7qp3-xv42
Timeline
- 2023-07-26: disclosed: Issue reported on GitHub
- 2023-09-28: advisory: GHSA and CVE advisory published
- 2023-09-28: patched: Fix released in version 3.22.3