Every CVE Search/ Get API key

CVE-2024-45296

path-to-regexp outputs backtracking regular expressions

7.5 HighFix available

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

0.93%Up 0.9 points since Sep 10, 2024
90%50%10%1%

What each source reports

CVE List Score used 7.5

path-to-regexp outputs backtracking regular expressions

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Record
CVE-2024-45296
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-1333
Updated
2026-11-02
EUVDEUVD-2024-2764 7.5

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Record
EUVD-2024-2764
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-03
GitHub AdvisoriesGHSA-9wv6-86v2-598j 7.7

path-to-regexp outputs backtracking regular expressions

Impact

A bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For example, /:a-:b.

Patches

For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

These versions add backtrack protection when a custom regex pattern is not provided:

They do not protect against vulnerable user supplied capture groups. Protecting against explicit user patterns is out of scope for old versions and not considered a vulnerability.

Version 7.1.0 can enable strict: true and get an error when the regular expression might be bad.

Version 8.0.0 removes the features that can cause a ReDoS.

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 to /:a-:b([^-/]+).

If paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length. For example, halving the attack string improves performance by 4x faster.

Details

Using /:a-:b will produce the regular expression /^\/([^\/]+?)-([^\/]+?)\/?$/. This can be exploited by a path such as /a${'-a'.repeat(8_000)}/a. OWASP has a good example of why this occurs, but the TL;DR is the /a at the end ensures this route would never match but due to naive backtracking it will still attempt every combination of the :a-:b on the repeated 8,000 -a.

Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and can lead to a DoS. In local benchmarks, exploiting the unsafe regex will result in performance that is over 1000x worse than the safe regex. In a more realistic environment using Express v4 and 10 concurrent connections, this translated to average latency of ~600ms vs 1ms.

References

Record
GHSA-9wv6-86v2-598j
CVSS 4.0
7.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-1333
Updated
2026-11-02
NVD 7.5

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Record
CVE-2024-45296
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-1333
Updated
2026-11-02
OSV 7.5

path-to-regexp outputs backtracking regular expressions

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Record
CVE-2024-45296
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-1333
Updated
2026-11-02
OSVCVE-2026-4867 7.5

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

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 [email protected] 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 [email protected]

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.

Record
CVE-2026-4867
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-1333
Updated
2026-11-02
Show 19 moreShow less
OSVDEBIAN-CVE-2024-45296 7.5

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Record
DEBIAN-CVE-2024-45296
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVGHSA-37ch-88jc-xwx2 7.5

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

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 [email protected] 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 [email protected]

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

Record
GHSA-37ch-88jc-xwx2
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-1333
Updated
2026-11-02
OSVGHSA-9wv6-86v2-598j 7.7

path-to-regexp outputs backtracking regular expressions

Impact

A bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For example, /:a-:b.

Patches

For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

These versions add backtrack protection when a custom regex pattern is not provided:

They do not protect against vulnerable user supplied capture groups. Protecting against explicit user patterns is out of scope for old versions and not considered a vulnerability.

Version 7.1.0 can enable strict: true and get an error when the regular expression might be bad.

Version 8.0.0 removes the features that can cause a ReDoS.

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 to /:a-:b([^-/]+).

If paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length. For example, halving the attack string improves performance by 4x faster.

Details

Using /:a-:b will produce the regular expression /^\/([^\/]+?)-([^\/]+?)\/?$/. This can be exploited by a path such as /a${'-a'.repeat(8_000)}/a. OWASP has a good example of why this occurs, but the TL;DR is the /a at the end ensures this route would never match but due to naive backtracking it will still attempt every combination of the :a-:b on the repeated 8,000 -a.

Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and can lead to a DoS. In local benchmarks, exploiting the unsafe regex will result in performance that is over 1000x worse than the safe regex. In a more realistic environment using Express v4 and 10 concurrent connections, this translated to average latency of ~600ms vs 1ms.

References

Record
GHSA-9wv6-86v2-598j
CVSS 4.0
7.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-1333
Updated
2026-11-02
OSVRHSA-2024:10762 7.0

Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update

Record
RHSA-2024:10762
CVSS 3.1
7.0 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:L
Updated
2026-11-02
OSVUBUNTU-CVE-2024-45296 7.5

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Record
UBUNTU-CVE-2024-45296
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVAZL-49085 No score

CVE-2024-45296 affecting package nodejs-nodemon 2.0.3-4

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Record
AZL-49085
Updated
2026-11-02
OSVAZL-49103 No score

CVE-2024-45296 affecting package js-jquery 3.5.0-4

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Record
AZL-49103
Updated
2026-11-02
OSVAZL-49117 No score

CVE-2024-45296 affecting package reaper for versions less than 3.1.1-13

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Record
AZL-49117
Updated
2026-11-02
OSVAZL-49158 No score

CVE-2024-45296 affecting package js-jquery 3.5.0-4

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Record
AZL-49158
Updated
2026-11-02
OSVAZL-49161 No score

CVE-2024-45296 affecting package nodejs-nodemon 2.0.3-5

path-to-regexp turns path strings into a regular expressions. In certain cases, path-to-regexp will output a regular expression that can be exploited to cause poor performance. Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and lead to a DoS. The bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (.). For users of 0.1, upgrade to 0.1.10. All other users should upgrade to 8.0.0.

Record
AZL-49161
Updated
2026-11-02
OSVCLSA-2026-1773360981 No score

TuxCare security update for path-to-regexp (2 CVEs)

TuxCare rebuilt path-to-regexp to address 2 CVEs. Fixed in 0.1.3-tuxcare.1.

Record
CLSA-2026-1773360981
Updated
2026-11-02
OSVCLSA-2026-1783731816 No score

TuxCare security update for path-to-regexp (1 CVE)

TuxCare rebuilt path-to-regexp to address 1 CVE. Fixed in 6.2.1-tuxcare.1.

Record
CLSA-2026-1783731816
Updated
2026-11-02
OSVCLSA-2026-1791833994 No score

TuxCare security update for path-to-regexp (1 CVE)

TuxCare rebuilt path-to-regexp to address 1 CVE. Fixed in 0.1.10-tuxcare.2.

Record
CLSA-2026-1791833994
Updated
2026-11-02
OSVCLSA-2026-1791843328 No score

TuxCare security update for path-to-regexp (2 CVEs)

TuxCare rebuilt path-to-regexp to address 2 CVEs. Fixed in 0.1.7-tuxcare.1.

Record
CLSA-2026-1791843328
Updated
2026-11-02
OSVCLSA-2026-1792473274 No score

TuxCare security update for path-to-regexp (1 CVE)

TuxCare rebuilt path-to-regexp to address 1 CVE. Fixed in 6.1.0-tuxcare.1.

Record
CLSA-2026-1792473274
Updated
2026-11-02
OSVopenSUSE-SU-2024:14374-1 No score

argocd-cli-2.12.4-1.1 on GA media

These are all security issues fixed in the argocd-cli-2.12.4-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:14374-1
Updated
2026-11-02
OSVopenSUSE-SU-2025:14663-1 No score

velociraptor-0.7.0.4.git142.862ef23-1.1 on GA media

These are all security issues fixed in the velociraptor-0.7.0.4.git142.862ef23-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2025:14663-1
Updated
2026-11-02
OSVROOT-APP-NPM-CVE-2024-45296 No score

CVE-2024-45296 in path-to-regexp - Patched by Root

Root has patched CVE-2024-45296 in the path-to-regexp package for Root:npm. Multiple fixed versions available.

Record
ROOT-APP-NPM-CVE-2024-45296
Updated
2026-11-02
OSVUSN-8290-1 No score

node-path-to-regexp vulnerability

It was discovered that Path-to-Regexp incorrectly handled route patterns containing multiple named parameters separated by non-delimiter characters such as hyphens. An attacker could possibly use this issue to cause a denial of service via catastrophic backtracking in the generated regular expressions.

Record
USN-8290-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
path-to-regexp
npm
before 0.1.10
0.1.10
path-to-regexp
npm
0.2.0 up to 1.9.0
1.9.0
path-to-regexp
npm
2.0.0 up to 3.3.0
3.3.0
path-to-regexp
npm
7.0.0 up to 8.0.0
8.0.0
path-to-regexp
npm
4.0.0 up to 6.3.0
6.3.0
nodejs-nodemon
Azure Linux:2
through 2.0.3-4 None known
js-jquery
Azure Linux:2
through 3.5.0-4 None known
reaper
Azure Linux:2
before 3.1.1-13
3.1.1-13
js-jquery
Azure Linux:3
through 3.5.0-4 None known
nodejs-nodemon
Azure Linux:3
through 2.0.3-5 None known
Show 29 moreShow less
Affected packages
PackageAffectedFixed
path-to-regexp
TuxCare:npm
0.1.3-tuxcare.0 up to 0.1.3-tuxcare.1, plus listed versions
0.1.3
0.1.3-tuxcare.1
path-to-regexp
TuxCare:npm
6.2.1-tuxcare.0 up to 6.2.1-tuxcare.1, plus listed versions
6.2.1
6.2.1-tuxcare.1
path-to-regexp
TuxCare:npm
0.1.10-tuxcare.0 up to 0.1.10-tuxcare.2, plus listed versions
0.1.100.1.10-tuxcare.1
0.1.10-tuxcare.2
path-to-regexp
TuxCare:npm
0.1.7-tuxcare.0 up to 0.1.7-tuxcare.1, plus listed versions
0.1.7
0.1.7-tuxcare.1
path-to-regexp
TuxCare:npm
6.1.0-tuxcare.0 up to 6.1.0-tuxcare.1, plus listed versions
6.1.0
6.1.0-tuxcare.1
node-path-to-regexp
Debian:12
All versions, plus listed versions
6.2.1-16.3.0-18.3.0-18.4.0-18.4.1-18.4.2-1
None known
node-path-to-regexp
Debian:13
before 6.3.0-1
6.3.0-1
node-path-to-regexp
Debian:14
before 6.3.0-1
6.3.0-1
path-to-regexp
npm
before 0.1.13
0.1.13
ansible-core
Red Hat:ansible_automation_platform_developer:2.4::el8
before 1:2.15.13-1.el8ap
1:2.15.13-1.el8ap
ansible-core
Red Hat:ansible_automation_platform_inside:2.4::el8
before 1:2.15.13-1.el8ap
1:2.15.13-1.el8ap
ansible-core
Red Hat:ansible_automation_platform:2.4::el8
before 1:2.15.13-1.el8ap
1:2.15.13-1.el8ap
ansible-core
Red Hat:ansible_automation_platform_developer:2.4::el9
before 1:2.15.13-1.el9ap
1:2.15.13-1.el9ap
ansible-core
Red Hat:ansible_automation_platform_inside:2.4::el9
before 1:2.15.13-1.el9ap
1:2.15.13-1.el9ap
ansible-core
Red Hat:ansible_automation_platform:2.4::el9
before 1:2.15.13-1.el9ap
1:2.15.13-1.el9ap
automation-controller-venv-tower
Red Hat:ansible_automation_platform:2.4::el8
before 0:4.5.13-1.el8ap
0:4.5.13-1.el8ap
automation-controller-venv-tower
Red Hat:ansible_automation_platform:2.4::el9
before 0:4.5.13-1.el9ap
0:4.5.13-1.el9ap
path-to-regexp
Root:npm
before 1.8.0-aikido.2
1.8.0-aikido.20.1.7-aikido.33.2.0-aikido.22.4.0-aikido.20.1.10-aikido.20.1.10-aikido.10.1.10-aikido.3
@rootio/path-to-regexp
Root:npm
before 1.8.0-root.io.1
1.8.0-root.io.10.1.7-root.io.10.1.7-root.io.21.8.0-root.io.20.1.7-root.io.33.2.0-root.io.13.2.0-root.io.22.4.0-root.io.20.1.10-root.io.20.1.10-root.io.10.1.10-root.io.3
node-path-to-regexp
Ubuntu:Pro:16.04:LTS
before 1.0.1-1ubuntu0.16.04.1~esm1, plus listed versions
1.0.1-1
1.0.1-1ubuntu0.16.04.1~esm1
node-path-to-regexp
Ubuntu:Pro:18.04:LTS
before 1.0.1-1ubuntu0.18.04.1~esm1, plus listed versions
1.0.1-1
1.0.1-1ubuntu0.18.04.1~esm1
node-path-to-regexp
Ubuntu:Pro:20.04:LTS
before 6.1.0-2ubuntu0.1~esm1, plus listed versions
3.0.0-23.1.0-16.1.0-2
6.1.0-2ubuntu0.1~esm1
node-path-to-regexp
Ubuntu:Pro:22.04:LTS
before 6.2.0-2ubuntu0.1~esm1, plus listed versions
6.2.0-16.2.0-2
6.2.0-2ubuntu0.1~esm1
node-path-to-regexp
Ubuntu:Pro:24.04:LTS
before 6.2.1-1ubuntu0.1~esm1, plus listed versions
6.2.1-1
6.2.1-1ubuntu0.1~esm1
node-express
Ubuntu:25.10
All versions, plus listed versions
4.21.0+~cs8.36.26-24.21.2+~cs8.36.27-14.21.2+~cs8.36.27-2
None known
node-express
Ubuntu:26.10
All versions, plus listed versions
5.1.0+~cs12.3.3-1build15.2.1+~cs12.3.9-1
None known
node-express
Ubuntu:26.04:LTS
All versions, plus listed versions
4.21.2+~cs8.36.27-24.21.2+~cs8.36.27-35.1.0+~cs12.3.3-1build1
None known
argocd-cli
openSUSE:Tumbleweed
before 2.12.4-1.1
2.12.4-1.1
velociraptor
openSUSE:Tumbleweed
before 0.7.0.4.git142.862ef23-1.1
0.7.0.4.git142.862ef23-1.1

History

History
RecordedChangedSources
aliases, products, publishedEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-45296 is a high vulnerability (CVSS 7.5) in Path-to-regexp, published September 9, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.93%, the 60th percentile. Fixed in path-to-regexp 0.1.10.

References

Show 66 moreShow less
MoveEnter Open