Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1tdnJwLTNjdngtYzMyNc4AA2PO

Zod denial of service vulnerability during email validation

Impact

API servers running express-zod-api having:

are vulnerable to a DoS attack due to:

Patches

The patched version of zod fixing the vulnerability is 3.22.3.

However, it's highly recommended to upgrade express-zod-api to at least version 10.0.0, which does not depend on zod strictly and directly, but requires its installation as a peer dependency instead, enabling you to install the patched zod version yourself.

Workarounds

When it's not possible to upgrade your dependencies, consider the following replacement in your implementation:

- z.string().email()
+ z.string().regex(
+   /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i
+ )

This regular expression is taken from the suggested patch of zod.

References

Permalink: https://github.com/advisories/GHSA-mvrp-3cvx-c325
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1tdnJwLTNjdngtYzMyNc4AA2PO
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 7 months ago
Updated: 7 months ago


CVSS Score: 7.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Identifiers: GHSA-mvrp-3cvx-c325
References: Repository: https://github.com/RobinTail/express-zod-api
Blast Radius: 5.2

Affected Packages

npm:express-zod-api
Dependent packages: 3
Dependent repositories: 5
Downloads: 13,617 last month
Affected Version Ranges: < 10.0.0-beta1
Fixed in: 10.0.0-beta1
All affected versions: 0.2.2, 0.2.3, 0.2.4, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.5.0, 0.6.0, 0.6.1, 0.7.0, 0.7.1, 0.7.2, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 2.0.0, 2.1.0, 2.1.1, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.4.0, 2.5.0, 2.5.1, 2.5.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, 14.0.2, 14.0.3, 14.1.0, 14.2.0, 14.2.1, 14.2.2, 14.2.3, 14.2.4, 14.2.5, 15.0.0, 15.0.1, 15.1.0, 15.2.0, 15.3.0, 15.3.1, 16.0.0, 16.1.0, 16.2.0, 16.2.1, 16.2.2, 16.3.0, 16.4.0, 16.4.1, 16.5.0, 16.5.1, 16.5.2, 16.5.3, 16.5.4, 16.6.0, 16.6.1, 16.6.2, 16.7.0, 16.7.1, 16.8.0, 16.8.1, 17.0.0, 17.0.1, 17.1.0, 17.1.1, 17.1.2, 17.2.0, 17.2.1, 17.3.0, 17.4.0, 17.4.1, 17.5.0, 17.6.0, 17.6.1, 17.7.0, 17.7.1, 18.0.0, 18.1.0, 18.2.0, 18.3.0