# CVE-2024-45296: path-to-regexp ReDoS via backtracking regular expressions

Source: https://junglewise.ai/threats/cve-2024-45296-path-to-regexp-redos-via-backtracking-regular-expressions  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-09-09. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2024-45296 · Severity: low · CVSS 3.1 · Published 2024-09-09

path-to-regexp is a routing library that converts URL paths into regular expressions for web applications. When two parameters are placed in a single segment (e.g., /:a-:b), the generated regex uses catastrophic backtracking that can be exploited to cause a denial-of-service by blocking the JavaScript event loop, making the application unresponsive to legitimate requests.

Technologies: [path-to-regexp (npm)](https://junglewise.ai/threats/technologies/path-to-regexp). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2024-45296 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-45296 being exploited in the wild.

**How severe is CVE-2024-45296?** Low severity, with a CVSS score of 3.1, published 9 September 2024.

**Which products and versions are affected?** path-to-regexp (npm) SEMVER:introduced=0.2.0,fixed=1.9.0.

**Is there a fix for CVE-2024-45296?** Yes. path-to-regexp (npm): upgrade to 1.9.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-45296 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2024-45296?** Check whether you run path-to-regexp (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- path-to-regexp (npm): upgrade to 1.9.0 or later

  ```sh
  npm install path-to-regexp@1.9.0
  ```


## Technical details

The vulnerability is a Regular Expression Denial of Service (ReDoS) caused by inefficient regex patterns generated when multiple parameters are separated by non-period characters within a single URL segment. Path patterns like /:a-:b generate regex like /^\/([^\/]+?)-([^\/]+?)\/?$/, which exhibits catastrophic backtracking. An attacker can exploit this by crafting a URL such as /a{'-a'.repeat(8000)}/a that triggers exponential regex backtracking. Since JavaScript regex matching runs on the main thread, this blocks the event loop and causes severe latency degradation (up to 1000x performance penalty). Patches are available in versions 0.1.10, 1.9.0, 3.3.0, 6.3.0, and 8.0.0; version 8.0.0 removes the vulnerable features entirely.

## Affected products

- pillarjs path-to-regexp <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

## Identifiers

- CVE-2024-45296
- CVE-2026-4867
- GHSA-9wv6-86v2-598j

## Timeline

- 2024-09-09: disclosed: Advisory published

## References

- [https://github.com/pillarjs/path-to-regexp/security/advisories/GHSA-9wv6-86v2-598j](https://github.com/pillarjs/path-to-regexp/security/advisories/GHSA-9wv6-86v2-598j)

## Related threats

- [path-to-regexp regular expression denial of service via multiple wildcards](https://junglewise.ai/threats/cve-2026-4923-pillarjs-path-to-regexp-redos-via-multiple-wildcards)
- [pillarjs path-to-regexp ReDoS via multiple route parameters](https://junglewise.ai/threats/cve-2026-4867-pillarjs-path-to-regexp-redos-via-multiple-route-parameters)
- [path-to-regexp denial of service via sequential optional groups](https://junglewise.ai/threats/cve-2026-4926-path-to-regexp-denial-of-service-via-sequential-optional-groups)
- [path-to-regexp ReDoS vulnerability](https://junglewise.ai/threats/cve-2024-52798-path-to-regexp-redos-vulnerability)
