CVE-2023-4316
High · 7.5CVSS
7.5
EPSS
0.9%
Published
Sep 28, 2023
CISA due date
—
Cloudanix analysis
A specially crafted email address can make affected applications slow down or stop responding.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Affected Zod versions 3.21.0 through 3.22.3 can consume excessive CPU while validating crafted email address input, resulting in denial of service. Because the issue is reachable over the network, requires no authentication, and needs no user interaction when an application exposes Zod-based email validation on public request paths, an attacker can repeatedly submit malicious email values to tie up application workers, event loops, serverless invocations, or API request capacity. The impact is availability-only; the flaw does not directly provide code execution, privilege escalation, data theft, or data modification.
Why it matters to the business
Public-facing registration, login, contact, checkout, password-reset, API, or form-submission workflows that validate email addresses with vulnerable Zod versions may become slow or unavailable under a small volume of malicious requests. This can cause customer-facing outages, increased infrastructure or serverless costs, failed transactions, support load, and degradation of dependent services. Although it is not listed in CISA KEV and has low EPSS probability, exploit code is available and the vulnerability has been public for a long time, so internet-exposed applications should treat remediation as a standard high-priority dependency update.
How an attack unfolds
An attacker first identifies an application endpoint that accepts an email address and validates it using an affected Zod release. The attacker then sends specially crafted, abnormally complex email strings designed to trigger excessive processing during validation. Each request can monopolize CPU or block the JavaScript runtime long enough to delay other requests. By repeating the requests or sending them concurrently, the attacker can exhaust available application workers, Node.js event-loop capacity, serverless execution concurrency, or upstream timeout budgets. The result is service degradation or denial of service without requiring authentication or successful account creation.
How to fix it
Upgrade Zod to a non-vulnerable release later than 3.22.3, preferably the latest stable version available for the application. If using brefphp/bref from source where this dependency is present, update to a revision containing commit c77d9f5abf021f29fa96b5720b7b84adbd199092 or a later fixed revision. Regenerate and commit dependency lockfiles after the upgrade, then redeploy all affected services and containers. As compensating controls until upgrade is complete, enforce strict maximum length limits on email fields before validation, reject obviously malformed oversized inputs at the edge or application router, apply per-IP and per-account rate limits to unauthenticated form/API endpoints, use request timeouts, and ensure autoscaling or serverless concurrency limits cannot be exhausted by a single source.
How to confirm the fix worked
Confirm dependency inventory no longer includes Zod versions 3.21.0 through 3.22.3 by checking package manifests, lockfiles, SBOMs, container images, and deployed artifacts. For source deployments of brefphp/bref, verify the deployed revision includes c77d9f5abf021f29fa96b5720b7b84adbd199092 or a later fixed commit. Run dependency scanners such as npm audit, osv-scanner, Snyk, Dependabot, GitHub Advanced Security, or equivalent SCA tooling against both source and built artifacts. Perform regression testing against all email-validation workflows using long and malformed email values and verify requests fail quickly with bounded CPU usage and consistent timeout behavior. Monitor production after deployment for reduced validation latency, fewer 5xx/timeout responses on email-input endpoints, and absence of vulnerable versions in runtime images.
Typical attack path
- Find public endpoints that accept email input, such as registration, login, password reset, newsletter signup, invite, contact, or API validation routes.
- Send test requests with unusual or very long email-address values and observe latency, timeout behavior, or error responses.
- Refine the payload to maximize validation processing time in the vulnerable Zod email validator.
- Send repeated or concurrent requests containing the crafted email value.
- Cause request queues, application workers, serverless functions, or API gateway timeouts to saturate, making the service slow or unavailable for legitimate users.
How to detect it
There are no known universally reliable payload strings or file artifacts that prove exploitation, so detection should focus on behavioral evidence around email-validation endpoints. Review HTTP access logs, API gateway logs, WAF logs, load balancer logs, application logs, APM traces, Node.js runtime metrics, container metrics, and serverless execution logs for bursts of requests to endpoints that accept email input followed by unusually high latency, request timeouts, 499/500/502/503/504 responses, CPU saturation, event-loop delay, worker exhaustion, or increased serverless duration/concurrency. Pay particular attention to unauthenticated sources sending very long, malformed, repetitive, or high-entropy email parameter values. Correlate suspicious requests with application performance data to determine whether CPU time was spent in validation logic and whether legitimate user traffic was delayed. If logs capture request bodies or sanitized field lengths, hunt for abnormal email field lengths and repeated failures from the same IPs, user agents, autonomous systems, or bot infrastructure. Preserve relevant access logs and APM traces before rotation because exploitation may leave only transient performance evidence.
What your security team should do
- Identify all applications, services, containers, and serverless functions that depend on Zod 3.21.0 through 3.22.3 or downstream packages bundling those versions.
- Prioritize internet-facing unauthenticated endpoints that accept email input, especially registration, password reset, invitation, contact, checkout, and API-validation routes.
- Upgrade Zod to a fixed current release and, where applicable, update brefphp/bref source deployments to commit c77d9f5abf021f29fa96b5720b7b84adbd199092 or later.
- Add or verify pre-validation input length limits for email fields and rate limits on unauthenticated endpoints.
- Review web, API gateway, application, APM, and infrastructure metrics for historical spikes in long-running requests, CPU saturation, 502/503/504 responses, and serverless timeout events tied to email-submission paths.
- Create temporary WAF or API gateway rules to block oversized email parameters and excessive request rates while remediation is rolling out.
- Ensure dependency scanning runs on lockfiles and built artifacts so vulnerable transitive copies are not missed.
The record
Zod in versions 3.21.0 up to and including 3.22.3 allows an attacker to perform a denial of service while validating emails.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| npm | zod | 0 | 3.22.3 |
| npm | zod | 3.22.2 | No fix |
Related vulnerabilities
- CVE-2026-112901 Pillow is a Python imaging library. CWE-1333
- CVE-2026-106454 Twisted is an event-based framework for internet applications, supporting Python 3.6+. CWE-1333
- CVE-2026-77387 geopy is a geocoding library for Python. CWE-1333
- CVE-2026-102990 basic-ftp is an FTP client for Node.js. CWE-1333
- CVE-2026-102473 A flaw was found in dash. CWE-1333
- CVE-2026-102270 PyJWT is a Python implementation of JSON Web Token standards. CWE-1333
- CVE-2026-101906 Axios is a promise-based HTTP client for the browser and Node.js. CWE-1333
- CVE-2026-101903 Axios is a promise-based HTTP client for the browser and Node.js. CWE-1333