medium5.9
CVE-2022-2596
node-fetch Inefficient Regular Expression Complexity
Impact
[node-fetch](https://www.npmjs.com/package/node-fetch) is a light-weight module that brings window.fetch to node.js. Affected 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'`.
Affected packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| npm | node-fetch | >= 3.0.0, < 3.2.10 | 3.2.10 |
Affected products
| Vendor | Product | Affected versions |
|---|---|---|
| Node-Fetch Project | Node-Fetch | from 3.0.0 before 3.2.10 |
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://github.com/node-fetch/node-fetch/commit/28802387292baee467e042e168d92597b5bbbe3d
- https://huntr.dev/bounties/a7e6a136-0a4b-46c4-ad20-802f1dd60bf7
- https://github.com/advisories/GHSA-vp56-6g26-6827
- https://nvd.nist.gov/vuln/detail/CVE-2022-2596
- https://github.com/node-fetch/node-fetch/pull/1611
- https://github.com/node-fetch/node-fetch/releases/tag/v3.2.10