CVE-2024-52798: path-to-regexp contains a ReDoS
Impact The regular expression that is vulnerable to backtracking can be generated in versions before 0.1.12 of path-to-regexp, originally reported in CVE-2024-45296 Patches Upgrade to 0.1.12. Workarounds Avoid using two parameters within a single path segment, when the separator is not . (e.g. no /:a-:b).
Published Dec 5, 2024 · Updated Jun 3, 2025
Affected packages
path-to-regexp
- Ecosystem
- npm
- Affected
- < 0.1.12
- Fixed in
- 0.1.12
- Check
npm ls path-to-regexp
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
The regular expression that is vulnerable to backtracking can be generated in versions before 0.1.12 of path-to-regexp, originally reported in CVE-2024-45296
Patches
Upgrade to 0.1.12.
Workarounds
Avoid using two parameters within a single path segment, when the separator is not . (e.g. no /:a-:b). Alternatively, you can define the regex used for both parameters and ensure they do not overlap to allow backtracking.
References
- https://github.com/advisories/GHSA-9wv6-86v2-598j
- https://blakeembrey.com/posts/2024-09-web-redos/
Credited to blakeembrey, ctcpip, goshop4eva, dloetzke.
References
- https://github.com/pillarjs/path-to-regexp/security/advisories/GHSA-rhx6-c78j-4q9w
- https://blakeembrey.com/posts/2024-09-web-redos
- https://nvd.nist.gov/vuln/detail/CVE-2024-52798
- https://github.com/pillarjs/path-to-regexp/commit/f01c26a013b1889f0c217c643964513acf17f6a4
- https://security.netapp.com/advisory/ntap-20250124-0002
- https://github.com/advisories/GHSA-rhx6-c78j-4q9w
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-4867
path-to-regexp vulnerable to Regular Expression Denial of Service via multiple route parameters
high7.5Mar 27, 2026CVE-2026-4923
path-to-regexp vulnerable to Regular Expression Denial of Service via multiple wildcards
medium5.9Mar 27, 2026CVE-2026-4926
path-to-regexp vulnerable to Denial of Service via sequential optional groups
high7.5Mar 27, 2026CVE-2024-45296
path-to-regexp outputs backtracking regular expressions
high7.5Sep 9, 2024
