CVE-2024-45296
path-to-regexp vulnerable to Regular Expression Denial of Service via multiple route parameters
Description
Impact
A bad regular expression is generated any time you have three or more parameters within a single segment, separated by something that is not a period (.). For example, /:a-:b-:c or /:a-:b-:c-:d. The backtrack protection added in path-to-regexp@0.1.12 only prevents ambiguity for two parameters. With three or more, the generated lookahead does not block single separator characters, so capture groups overlap and cause catastrophic backtracking.
Patches
Upgrade to path-to-regexp@0.1.13
Custom regex patterns in route definitions (e.g., /:a-:b([^-/]+)-:c([^-/]+)) are not affected because they override the default capture group.
Workarounds
All versions can be patched by providing a custom regular expression for parameters after the first in a single segment. As long as the custom regular expression does not match the text before the parameter, you will be safe. For example, change /:a-:b-:c to /:a-:b([^-/]+)-:c([^-/]+).
If paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length.
References
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » path-to-regexpvia npm path-to-regexp | < 0.1.13< 0.1.10>= 0.2.0, < 1.9.0>= 2.0.0, < 3.3.0>= 4.0.0, < 6.3.0>= 7.0.0, < 8.0.0 | 0.1.13, 0.1.10, 1.9.0, 3.3.0, 6.3.0, 8.0.0 |
| org.webjars.npm » path-to-regexpvia npm path-to-regexp | < 0.1.13< 0.1.10>= 0.2.0, < 1.9.0>= 2.0.0, < 3.3.0>= 4.0.0, < 6.3.0>= 7.0.0, < 8.0.0 | 0.1.13, 0.1.10, 1.9.0, 3.3.0, 6.3.0, 8.0.0 |
Blast radius
39% of the dependent artifacts (144) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 269 |
| 2 hops | 403 |
| 3 hops | 6,067 |
| 4 hops | 7,978 |
| 5 hops | 1,976 |
| 6 hops | 263 |
Most used dependents
- io.quarkus » quarkus-vertx-http-deployment193 usages
- io.quarkus » quarkus-resteasy-deployment129 usages
- io.quarkus » quarkus-rest-deployment112 usages
- io.quarkus » quarkus-smallrye-health-deployment89 usages
- io.quarkus » quarkus-rest-jackson-deployment77 usages
- io.quarkiverse.langchain4j » quarkus-langchain4j-core-deployment64 usages
- io.quarkus » quarkus-smallrye-openapi-deployment59 usages
- io.quarkus » quarkus-micrometer-deployment55 usages
- io.quarkus » quarkus-resteasy-jackson-deployment55 usages
- io.quarkus » quarkus-undertow-deployment51 usages
- io.quarkus » quarkus-resteasy-reactive-deployment51 usages
- org.eclipse.dirigible » dirigible-api49 usages
- io.quarkus » quarkus-reactive-routes-deployment43 usages
- org.webjars.npm » express38 usages
- io.quarkus » quarkus-oidc-deployment35 usages
Computed from the dependency graph of build 20261127.1117 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) . See all on OSV
References
| Advisory | NVD CVE-2026-4867 | nvd.nist.gov |
| Advisory | GitHub advisory GHSA-9wv6-86v2-598j | github.com |
| Package | pillarjs/path-to-regexp | github.com |
| Web | pillarjs/path-to-regexp advisory GHSA-37ch-88jc-xwx2 | github.com |
| Web | posts/2024-09-web-redos | blakeembrey.com |
| Web | security-advisories.html | cna.openjsf.org |
| Web | pillarjs/path-to-regexp release v.0.1.13 | github.com |
