CVE-2022-2596: Node fetch Node-fetch Inefficient Regular Expression Complexity Vulnerability
MODERATECVE-2022-2596 is a MODERATE (CVSS 5.9) node-fetch inefficient regular expression complexity vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Node fetch libraries in the npm ecosystem. The issue involves node-fetch inefficient regular expression complexity. Remediation is available by upgrading affected packages to version 3.2.10.
CVE-2022-2596 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2022-2596
To remediate this vulnerability, upgrade all affected Node fetch 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 node-fetch@3.2.10
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls node-fetch
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-2596, inspect your project dependencies using npm:
npm ls node-fetch
Analyze the terminal output to locate any version of Node fetch in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.10), your application is affected.
Note: The npm ls node-fetch 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Node fetch, 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-2022-2596 Affected Node fetch Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
node-fetch
|
npm |
≥ 3.0.0
< 3.2.10
|
3.2.10
|
References
Frequently Asked Questions
What is CVE-2022-2596?
Which Node fetch versions are affected?
What version fixes CVE-2022-2596?
Is node-fetch affected?
What is the CVSS score of CVE-2022-2596?
What CWE is associated with CVE-2022-2596?
How can I check npm dependencies for CVE-2022-2596?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vp56-6g26-6827",
"modified" : "2022-08-04T17:37:24Z",
"published" : "2022-08-02T00:00:25Z",
"aliases" : [ "CVE-2022-2596" ],
"summary" : "node-fetch Inefficient Regular Expression Complexity ",
"details" : "[node-fetch](https://www.npmjs.com/package/node-fetch) is a light-weight module that brings window.fetch to node.js.\n\nAffected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) in the `isOriginPotentiallyTrustworthy()` function in `referrer.js`, when processing a URL string with alternating letters and periods, such as `'http://' + 'a.a.'.repeat(i) + 'a'`.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "node-fetch"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.2.10"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-2596"
}, {
"type" : "WEB",
"url" : "https://github.com/node-fetch/node-fetch/pull/1611"
}, {
"type" : "WEB",
"url" : "https://github.com/node-fetch/node-fetch/commit/28802387292baee467e042e168d92597b5bbbe3d"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/node-fetch/node-fetch"
}, {
"type" : "WEB",
"url" : "https://github.com/node-fetch/node-fetch/releases/tag/v3.2.10"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/a7e6a136-0a4b-46c4-ad20-802f1dd60bf7"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333", "CWE-400" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-08-04T17:37:24Z",
"nvd_published_at" : "2022-08-01T15:15:00Z"
}
}