CVE-2022-0235: node-fetch forwards secure headers to untrusted sites
8.8
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.67181%
CWE
Published
1/21/2022
Updated
11/29/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| node-fetch | npm | >= 3.0.0, < 3.1.1 | 3.1.1 |
| node-fetch | npm | < 2.6.7 | 2.6.7 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the absence of a domain validation check during redirects in the fetch implementation. The fix introduced the 'isDomainOrSubdomain' check to strip sensitive headers when redirecting to untrusted domains. The vulnerable code existed in the redirect handling portion of the fetch function, which previously forwarded headers without this security check. The commit diff and CVE description confirm the lack of origin validation was the root cause.