path-to-regexp vulnerable to Regular Expression Denial of Service via multiple wildcards
Moderate severity
GitHub Reviewed
Published
Mar 26, 2026
in
pillarjs/path-to-regexp
•
Updated Mar 27, 2026
Description
Published by the National Vulnerability Database
Mar 26, 2026
Published to the GitHub Advisory Database
Mar 27, 2026
Reviewed
Mar 27, 2026
Last updated
Mar 27, 2026
Impact
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:
Patches
Upgrade to version
8.4.0.Workarounds
If developers are using multiple wildcard parameters, they can check the regex output with a tool such as https://makenowjust-labs.github.io/recheck/playground/ to confirm whether a path is vulnerable.
References