All vulnerabilities

npm

CVE-2026-118772

joi: quadratic-time split in `string().email({ multiple: true })` allows denial of service

Severity
High 7.5
Published
30 Oct 2026
Last changed
30 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
17.13.9, 18.3.1
Exploit chance
0.6% in the next 30 daysHigher than 47% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Regular expression denial of service (ReDoS) (CWE-1333)
Attack
Over the network · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-4528-x5fx-h6hg
Sources
OSV.dev and GitHub

Description

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.

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:

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:

The split results do not change. The regular expression is now built only when multiple is set.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
@hapi/joinpm · osv:npm:@hapi/joi
  • From 16.0.0 up to 17.1.1
joinpm · osv:npm:joi
  • From 17.1.1 before 17.13.9
  • From 18.0.0 before 18.3.1

About @hapi/joi

Weekly downloads (npm)
2,054,687npm, 23 Nov 2026

This is the only vulnerability in @hapi/joi in our list.

About joi

Weekly downloads (npm)
34,187,336npm, 23 Nov 2026

Vulnerabilities in joi

In our list
2
Published in the last 12 months
2
Critical, last 12 months
0
High, last 12 months
1
Known exploited
0
Search the list for joi

References