CVE-2026-4867
path-to-regexp: path-to-regexp: Denial of Service via catastrophic backtracking from malformed URL parameters
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · March 27, 2026
Updated · October 27, 2026
Description
A flaw was found in path-to-regexp. A remote attacker could exploit this vulnerability by crafting a malicious URL with three or more parameters in a single segment, separated by non-period characters. This causes the component to generate a bad regular expression, leading to catastrophic backtracking. The overlapping capture groups can consume excessive processing resources, resulting in a Denial of Service (DoS) for the affected application.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
To mitigate this issue, applications using path-to-regexp can implement custom regular expressions for parameters beyond the first in a single URL segment. For example, a route like /:a-:b-:c can be rewritten as /:a-:b([^-/]+)-:c([^-/]+). Alternatively, limiting the maximum length of incoming URLs can also reduce the risk of exploitation. These changes require application-level configuration and may necessitate a service restart to take effect.
CVSS / CWE
CVSS 3.1 · 5.3CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CWE-1333 · Inefficient Regular Expression Complexity