CVE-2020-15168 — Vulnerability in node-fetch — CVE Details
The `size` option isn't honored after following a redirect in node-fetch
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.69%). Schedule for your next planned update.
Does your project use an affected node-fetch version?
Paste your package-lock.json to check it for CVE-2020-15168 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Impact
Node Fetch did not honor the size option after following a redirect, which means that when a content size was over the limit, a FetchError would never get thrown and the process would end without failure.
For most people, this fix will have a little or no impact. However, if you are relying on node-fetch to gate files above a size, the impact could be significant, for example: If you don't double-check the size of the data after fetch() has completed, your JS thread could get tied up doing work on a large file (DoS) and/or cost you money in computing.
Patches
We released patched versions for both stable and beta channels:
- For
v2: 2.6.1 - For
v3: 3.0.0-beta.9
Workarounds
None, it is strongly recommended to update as soon as possible.
For more information
If you have any questions or comments about this advisory:
- Open an issue in node-fetch
- Contact one of the core maintainers.
Advisory Timeline
- First published September 10, 2020 (2268 days ago).
- Last revised July 8, 2026 — 2127 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
npm install node-fetch@2.6.1
npm install node-fetch@3.0.0-beta.9
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: npm (1).
| Package | Fixed In |
|---|---|
| node-fetch npm · Affected: All versions | 2.6.1 |
| node-fetch npm · Affected: All versions | 3.0.0-beta.9 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 2.6 score means for each attack dimension.
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:L
References
- https://github.com/node-fetch/node-fetch/security/advisories/GHSA-w7rc-rwvf-8q5rWEB
- https://nvd.nist.gov/vuln/detail/CVE-2020-15168ADVISORY
- https://github.com/node-fetch/node-fetch/commit/2358a6c2563d1730a0cdaccc197c611949f6a334WEB
- https://github.com/node-fetch/node-fetch/commit/eaff0094c4dfdd5b78711a8c4f1b61e33d282072WEB
- https://github.com/node-fetch/node-fetchPACKAGE
Frequently Asked Questions
- What is CVE-2020-15168?
- The `size` option isn't honored after following a redirect in node-fetch. This vulnerability has been assigned a severity rating of LOW (CVSS score: 2.6/10).
- How do I check if my project is affected by CVE-2020-15168?
- CVE-2020-15168 affects node-fetch. It has a 1.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2020-15168 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation is difficult, or the impact is minor.
This places it in the top quartile of EPSS-scored vulnerabilities — 77.5% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.
Also Known As
Related CVEs
- CVE-2022-0235HIGH
node-fetch forwards secure headers to untrusted sites
- CVE-2026-94486LOW
Next.js has information disclosure in development server's Model Context Protocol endpoint
- CVE-2026-77063LOW
multer vulnerable to file size limit bypass via async fileFilter race condition