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
- angular vulnerable to regular expression denial of service via the angular.copy() utility - CVE-2023-26116
- angular vulnerable to regular expression denial of service via the $resource service - CVE-2023-26117


