MediumGHSA-vp56-6g26-6827CVE-2022-2596

node-fetch Inefficient Regular Expression Complexity

Published 2 Aug 2022 · Updated 8 Nov 2023

Affected package

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.10

Details

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

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.