Description
When using multiple wildcards, combined with at least one parameter, a regular expression can be generated that is vulnerable to ReDoS. This backtracking vulnerability requires the second wildcard to be somewhere other than the end of the path.
Unsafe examples:
Safe examples:
Recommendation
Update the path-to-regexp package to the latest compatible version. Followings are version details:
- Affected version(s): >= 8.0.0, < 8.4.0
- Patched version(s): 8.4.0
References
Could your website be exposed too?
SmartScanner can check your website for path-to-regexp vulnerable to Regular Expression Denial of Service via multiple wildcards and gives you actionable findings to investigate.
Start a free scanRelated Issues
- path-to-regexp vulnerable to Regular Expression Denial of Service via multiple route parameters - CVE-2026-4867
- path-to-regexp vulnerable to Denial of Service via sequential optional groups - CVE-2026-4926
- steal vulnerable to Regular Expression Denial of Service via input variable - CVE-2022-37260
- steal vulnerable to Regular Expression Denial of Service via source and sourceWithComments - CVE-2022-37262


