joi: quadratic-time split in `string().email({ multiple: true })` allows denial of service
CVE-2026-118772
Summary Joi.string().email({ multiple: true }) takes quadratic time to split a value that contains a long run of whitespace. One request with 100 KB of spaces blocks the Node.js event loop for several seconds, which causes a denial of service. Details When the multiple option is set, the email rule splits the value into addresses with a regular expression that removes whitespace on each side of the separator: js const regex = new RegExp(\\s[${options.separator ? escapeRegex(options.separator) : ','}]\\s); // ... const emails = options.multiple ? value.split(regex) : [value]; String.prototype.split tries a match at each position of the value. At each position inside a whitespace run, the leading \s reads the rest of the run, does not find a separator, and backtracks through all of it. A run of n whitespace characters without a separator therefore costs n² steps. This applies to the default separator and to all custom separator values. The fix lets the leading whitespace match start only at the beginning of a whitespace run, so the split is linear: js const regex = new RegExp((?:(? "} Impact This is a denial of service by CPU exhaustion. It affects each application that validates…
Assessment
- CVSS
- 7.5 (v3.1)
- Severity
- High
- EPSS
- 0.00467% chance of exploitation in the next 30 days
- Known exploited
- Not listed in CISA KEV
- Exploit availability
- Nothing found in Exploit-DB, Metasploit, Nuclei or public PoC repositories
- Published
- 30 October 2026
- Last updated
- 30 October 2026
- Affected
- npm · joi, @hapi/joi
- Weakness
- CWE-1333
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
At the source
References
- https://github.com/hapijs/joi/security/advisories/GHSA-4528-x5fx-h6hg
- https://nvd.nist.gov/vuln/detail/CVE-2026-118772
- https://github.com/hapijs/joi/pull/3162
- https://github.com/hapijs/joi/pull/3163
- https://github.com/hapijs/joi/commit/03dc1d909818503b06240dadc81e9227ed2649cf
- https://github.com/hapijs/joi/commit/807858d7480f5075b0610817e3e44230890fb18e
- https://github.com/hapijs/joi/releases/tag/v17.13.9
- https://github.com/hapijs/joi/releases/tag/v18.3.1
- https://github.com/advisories/GHSA-4528-x5fx-h6hg
Query this programmatically
Agents can read this through the MCP endpoint, or over HTTP:
curl https://cve.zerocrew.in/api/cve/CVE-2026-118772