Vulnerabilities/

path-to-regexp vulnerable to Regular Expression Denial of Service via multiple wildcards

Severity:
Medium

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:

References

Related Issues

Tags:
npm
path-to-regexp
Anything's wrong? Let us know Last updated on March 27, 2026