MediumGHSA-vp56-6g26-6827CVE-2022-2596
node-fetch Inefficient Regular Expression Complexity
Published 2 Aug 2022 · Updated 8 Nov 2023
Affected package
node-fetchnpm
- Affected
- >=3.0.0 <3.2.10
- Fixed in
- 3.2.10
Update to the fixed version for your release line, for example:
npm install node-fetch@3.2.10Details
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'.
Is GHSA-vp56-6g26-6827 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected node-fetch, and gives you the command that fixes it.
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2022-2596
- Linkgithub.com/node-fetch/node-fetch/pull/1611
- Linkgithub.com/node-fetch/node-fetch/commit/28802387292baee467e042e168d92597b5bbbe3d
- Packagegithub.com/node-fetch/node-fetch
- Linkgithub.com/node-fetch/node-fetch/releases/tag/v3.2.10
- Linkhuntr.dev/bounties/a7e6a136-0a4b-46c4-ad20-802f1dd60bf7
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.