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
- 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.
Affected software
| Software | Affected versions |
|---|---|
@hapi/joinpm · osv:npm:@hapi/joi |
|
joinpm · osv:npm:joi |
|
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
- CVE-2026-122131Joi 17.13.6 before 17.13.9 and 18.2.5 before 18.3.1 Prototype Replacement via __proto__ Language KeyMedium 6.3 4 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-118772
- GitHub Advisory Database https://github.com/advisories/GHSA-4528-x5fx-h6hg