Skip to main content

Inefficient Regular Expression Complexity

CVE-2024-45296

Severity High
Score 7.5/10

Summary

The path-to-regexp turns path strings into regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). This issue affects path-to-regexp versions through 0.1.9, 0.2.0 through 1.8.0, 2.0.0 through 3.2.0, 4.0.0 through 6.2.2, and 7.0.0 through 7.2.0.

  • LOW
  • NETWORK
  • NONE
  • UNCHANGED
  • NONE
  • NONE
  • NONE
  • HIGH

CWE-1333 - Inefficient Regular Expression Complexity

The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.

Advisory Timeline

  • Published