CVE-2024-52798 path-to-regexp Unpatched `path-to-regexp` ReDoS in 0.1.x

High 7.7 Published Updated

Attackers can cause denial of service via ReDoS in path-to-regexp by providing malicious path strings that trigger excessive backtracking.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-52798?

CVE-2024-52798 is a high-severity denial of service vulnerability in pillarjs path-to-regexp, published on 5 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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. The regular expression that is vulnerable to backtracking can be generated in the 0.1.x release of path-to-regexp. Upgrade to 0.1.12. This vulnerability exists because of an incomplete fix for CVE-2024-45296.

Weakness: CWE-1333

Which versions are affected by CVE-2024-52798?

2 open source packages ship an affected version, including path-to-regexp.

PackageAffectedFixed in
path-to-regexp npmAll versions0.1.12
path-to-regexp npmAll versions0.1.12

How do I fix CVE-2024-52798?

Upgrade path-to-regexp to 0.1.12 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2024-52798 being exploited?

There is no known exploitation of CVE-2024-52798 in the wild and no public exploit code.

Sources

Also known as AZL-54017, AZL-54020, AZL-54036, CLEANSTART-2026-BK66130, CLEANSTART-2026-ZQ97544, CLSA-2026-1790520007 and 5 more.

Is CVE-2024-52798 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free