CVE-2024-52798: Path to regexp Denial of Service Vulnerability
HIGHCVE-2024-52798 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Path to regexp libraries in the npm ecosystem. The issue involves path-to-regexp contains a redos. Remediation is available by upgrading affected packages to version 0.1.12.
CVE-2024-52798 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2024-52798
To remediate this vulnerability, upgrade all affected Path to regexp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install path-to-regexp@0.1.12
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls path-to-regexp
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-52798, inspect your project dependencies using npm:
npm ls path-to-regexp
Analyze the terminal output to locate any version of Path to regexp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.12), your application is affected.
Note: The npm ls path-to-regexp command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Path to regexp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-52798 Affected Path to regexp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
path-to-regexp
|
npm |
< 0.1.12
|
0.1.12
|
References
Frequently Asked Questions
What is CVE-2024-52798?
Which Path to regexp versions are affected?
What version fixes CVE-2024-52798?
Is path-to-regexp affected?
What is the CVSS score of CVE-2024-52798?
What CWE is associated with CVE-2024-52798?
How can I check npm dependencies for CVE-2024-52798?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rhx6-c78j-4q9w",
"modified" : "2025-06-03T14:30:56Z",
"published" : "2024-12-05T22:40:47Z",
"aliases" : [ "CVE-2024-52798" ],
"summary" : "path-to-regexp contains a ReDoS",
"details" : "### Impact\n\nThe regular expression that is vulnerable to backtracking can be generated in versions before 0.1.12 of `path-to-regexp`, originally reported in CVE-2024-45296\n\n### Patches\n\nUpgrade to 0.1.12.\n\n### Workarounds\n\nAvoid using two parameters within a single path segment, when the separator is not `.` (e.g. no `/:a-:b`). Alternatively, you can define the regex used for both parameters and ensure they do not overlap to allow backtracking.\n\n### References\n\n- https://github.com/advisories/GHSA-9wv6-86v2-598j\n- https://blakeembrey.com/posts/2024-09-web-redos/",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS: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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "path-to-regexp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.1.12"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pillarjs/path-to-regexp/security/advisories/GHSA-rhx6-c78j-4q9w"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-52798"
}, {
"type" : "WEB",
"url" : "https://github.com/pillarjs/path-to-regexp/commit/f01c26a013b1889f0c217c643964513acf17f6a4"
}, {
"type" : "WEB",
"url" : "https://blakeembrey.com/posts/2024-09-web-redos"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pillarjs/path-to-regexp"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20250124-0002"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-12-05T22:40:47Z",
"nvd_published_at" : "2024-12-05T23:15:06Z"
}
}