joi regular expression denial of service in isoDate validation

Severity: high · CVSS 7.5 · Published 2026-09-17

joi is a popular data validation library for Node.js applications. The isoDate validation rule contains a quadratic regular expression that causes the application to consume excessive CPU time when processing specially crafted input. An attacker can stall or crash an application by sending a single request with a malicious string to a validation function.

Technologies: joi (npm). Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
High severity, with a CVSS score of 7.5, published 17 September 2026.
Which products and versions are affected?
Hapi.Js Joi >=17.2.0 <17.13.7, >=18.0.0 <18.2.6; joi (npm) >= 18.0.0, < 18.2.6.
Is there a fix for This vulnerability?
Yes: fixed in 17.13.7, 18.2.6. Until then: Cap the length of input strings before passing them to joi for validation with isoDate(). Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether you run Hapi.Js Joi or joi (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Fixed in: 17.13.7, 18.2.6

Cap the length of input strings before passing them to joi for validation with isoDate().

Technical details

The vulnerability is a regular expression denial of service (ReDoS) in the Joi.string().isoDate() validator caused by an unanchored regex pattern. When an attacker supplies a valid ISO date followed by a long sequence of fractional-second digits, the regex engine restarts its search from every position in the string, resulting in quadratic time complexity proportional to the square of input length. No authentication is required; any application accepting user input validated with isoDate() is affected.

Affected products

  • hapi.js joi >=17.2.0 <17.13.7, >=18.0.0 <18.2.6

Timeline

  • 2026-09-02: disclosed
  • 2026-09-17: advisory
  • 2026-09-02: patched: Patches available as 17.13.7 and 18.2.6

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.