Zod 3.22.2 - Regular expression Denial of Service
7,5
High
Discovered by
Offensive Team, Fluid Attacks
Summary
Full name
Zod 3.22.2 - Regular expression Denial of Service
Code name
State
Public
Release date
28 sept 2023
Affected product
Zod
Affected version(s)
Version 3.22.2
Vulnerability name
Asymmetric denial of service - ReDoS
Vulnerability type
Remotely exploitable
Yes
CVSS v3.1 vector string
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS v3.1 base score
7.5
Exploit available
Yes
CVE ID(s)
Description
Zod in version 3.22.2 allows an attacker to perform a denial of service while validating emails
Vulnerability
Zod performs validations to determine if a string belongs to a valid email, the validations use of a vulnerable regular expression that allows an attacker to send a malicious string of data to generate excessive processing overhead and ultimately crash the server. It was identified that by sending a string of data of a predetermined length and increasing the number of characters, the time it takes for the application to process the request grows exponentially.
Exploitation
The application uses the following vulnerable regular expression:
First we create a scheme to validate emails:
And perform validation:
Evidence of exploitation
First we send invalid information and we can see that the validation done by Zod works correctly, but when we increase the number of characters in the request for the invalid data, we can see that the processing time increases until the server stops responding.
Our security policy
We have reserved the ID CVE-2023-4316 to refer to this issue from now on. Disclosure policy
System Information
Version: Zod 3.22.2
Operating System: GNU/Linux
Mitigation
There is currently no patch available for this vulnerability.
References
Vendor page https://zod.dev/
Timeline
IA generativa
18 sept 2023
Vendor contacted
19 sept 2023
Public disclosure
28 sept 2023