Vulnerability · Published Mar 26, 2026 · Assigned by openjs
CVE-2026-4867path-to-regexp vulnerable to Regular Expression Denial of Service via multiple route parameters
High 7.5
In plain English
A high-severity regular-expression denial of service in path-to-regexp from path-to-regexp. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 44% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | node-path-to-regexp | 1.0.1-1 | DEBIAN-CVE-2026-4867 |
| Debian:13 | node-path-to-regexp | 1.0.1-1 | DEBIAN-CVE-2026-4867 |
| Debian:14 | node-path-to-regexp | 1.0.1-1 | DEBIAN-CVE-2026-4867 |
| npm | path-to-regexp | 8.0.0 | GHSA-9wv6-86v2-598j |
| npm | path-to-regexp | 0.1.13 | GHSA-37ch-88jc-xwx2 |
| npm | path-to-regexp | 6.3.0 | GHSA-9wv6-86v2-598j |
| npm | path-to-regexp | 3.3.0 | GHSA-9wv6-86v2-598j |
| npm | path-to-regexp | 1.9.0 | GHSA-9wv6-86v2-598j |
| npm | path-to-regexp | 0.1.10 | GHSA-9wv6-86v2-598j |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| path-to-regexp | path-to-regexp | 0 – before 0.1.13 |
Weakness: CWE-1333 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H