Junglewise Threat Intelligence

CVE-2024-52798: path-to-regexp ReDoS vulnerability

CVE-2024-52798 · Severity: low · CVSS 3.1 · Published 2024-12-05

Technologies: path-to-regexp (npm). Vendors: Pillarjs, npm.

Executive brief

path-to-regexp is a popular JavaScript library used to convert URL path strings into regular expressions for routing in web applications. A regular expression denial-of-service (ReDoS) vulnerability allows attackers to send specially crafted path patterns that cause excessive CPU consumption, potentially making the application unresponsive or unavailable to legitimate users.

Technical details

The vulnerability is a Regular Expression Denial of Service (ReDoS) in the regular expression generation logic of path-to-regexp versions before 0.1.12. The vulnerable code can be triggered when two parameters are used within a single path segment with a separator that is not a dot (e.g., /:a-:b), which generates a regex susceptible to catastrophic backtracking. An attacker with network access can provide a crafted path pattern that causes exponential time complexity in regex matching, consuming excessive CPU resources. The vulnerability requires no authentication or user interaction and has high availability impact. The fix is available in version 0.1.12, which addresses the regex pattern generation to prevent backtracking scenarios.

Affected products

  • pillarjs path-to-regexp <0.1.12

Timeline

  • 2024-12-05: disclosed: GHSA-rhx6-c78j-4q9w advisory published
  • 2024-12-05: patched: Version 0.1.12 released with fix

References

Related threats