CVE-2020-15168: Node-fetch size option not honored after redirect

node-fetch Updated 02 Oct 2025

Summary

10/09/2020
Yes i
Low
2.6

CVE-2020-15168: The size option isn't honored after following a redirect in node-fetch. Affects node-fetch across 2 version ranges.

>= 2.0.0, < 2.6.1 >= 3.0.0-beta.1, < 3.0.0-beta.9

Fixed in 2.6.1 or 3.0.0-beta.9, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2020-15168 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Node-fetch is an npm package that provides a lightweight implementation of the Fetch API for Node.js. It allows developers to make HTTP requests and handle responses in a convenient manner. However, a vulnerability has been discovered in node-fetch versions 0 to 2.6.0 and 3.0.0-beta.1 to 3.0.0-beta.8. This vulnerability relates to the size option not being honored after following a redirect.

Vulnerability Detail

The vulnerability in node-fetch occurs when the size option is used to limit the content size of a response. Prior to the fix, if a redirect occurred and the content size exceeded the specified limit, a FetchError would not be thrown. This means that the process would continue without failure, potentially leading to resource exhaustion or unexpected costs. While the impact of this vulnerability may be minimal for most users, those relying on node-fetch to gate files based on size could be significantly affected.

How To Fix

Latest published version: 3.3.2 as of 22 Oct 2026

npm install node-fetch@3.3.2

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 2.0.0, < 2.6.1 2.6.1
    npm install node-fetch@2.6.1
  • >= 3.0.0-beta.1, < 3.0.0-beta.9 3.0.0-beta.9
    npm install node-fetch@3.0.0-beta.9

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There are no known workarounds for this vulnerability. It is strongly advised to update to the patched versions as soon as possible.

Conclusion

In conclusion, the vulnerability in node-fetch related to the size option not being honored after a redirect can have significant impacts for those relying on file size gating. It is crucial to update to the patched versions (2.6.1 for v2 and 3.0.0-beta.9 for v3) to ensure the proper handling of content size limits. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for node-fetch →

Share this vulnerability

FAQ

Node-fetch is an npm package that provides a lightweight implementation of the Fetch API for Node.js. It allows developers to make HTTP requests and handle responses in a convenient manner.

The impact of this vulnerability may be minimal for most users. However, for those relying on node-fetch to gate files based on size, the impact could be significant. It could lead to resource exhaustion, denial of service, or unexpected costs.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities without requiring access to the code or installation.

There are no known workarounds for this vulnerability. It is strongly advised to update to the patched versions of node-fetch.

For more information, you can open an issue in the node-fetch GitHub repository or contact one of the core maintainers.

Related vulnerabilities

Recent vulnerabilities recorded for node-fetch.

How To Fix

Latest published version: 3.3.2 as of 22 Oct 2026

npm install node-fetch@3.3.2

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 2.0.0, < 2.6.1 2.6.1
    npm install node-fetch@2.6.1
  • >= 3.0.0-beta.1, < 3.0.0-beta.9 3.0.0-beta.9
    npm install node-fetch@3.0.0-beta.9

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback