Inefficient Regular Expression Complexity in node-fetch: CVE-2022-2596

node-fetch Updated 02 Oct 2025

Summary

01/08/2022
N/A
No i
Medium
5.9

UBUNTU-CVE-2022-2596: Inefficient Regular Expression Complexity in GitHub repository node-fetch/node-fetch prior to 3.2.10. Affects node-fetch versions 1.7.3-1 – 1.7.3-1ubuntu0.1~esm1. No fix is published. How to fix ↓

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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

node-fetch is a lightweight module that enables HTTP requests in Node.js, providing a simple interface for making network requests. It is widely used in various applications for fetching resources from the web. However, certain versions of node-fetch are vulnerable to an inefficient regular expression complexity issue, which can lead to performance degradation and potential denial of service in applications utilizing this package.

Vulnerability Detail

The vulnerability, identified as CVE-2022-2596, arises from inefficient regular expression handling in node-fetch versions prior to 3.2.10. This flaw can be exploited by attackers to craft specific inputs that cause excessive backtracking in the regex engine, leading to significant performance issues or even application crashes. The vulnerability is particularly concerning as it can be triggered by untrusted input, making it a potential vector for denial-of-service attacks.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If immediate updating is not feasible, consider implementing input validation to sanitize any user inputs that may interact with the regular expressions in node-fetch. This can help mitigate the risk of exploitation until the package can be updated.

Conclusion

CVE-2022-2596 represents a significant vulnerability in the node-fetch package, which can lead to performance issues and denial-of-service attacks. Users are strongly encouraged to update to the latest version to protect their applications. Additionally, utilizing input validation can serve as a temporary measure to reduce risk.

See every vulnerability recorded for node-fetch →

Share this vulnerability

FAQ

CVE-2022-2596 is a vulnerability in node-fetch that involves inefficient regular expression complexity, potentially leading to performance degradation.

Versions of node-fetch prior to 3.2.10 are affected by this vulnerability.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Exploitation of this vulnerability can lead to denial-of-service attacks, causing applications to slow down or crash.

Yes, implementing input validation to sanitize user inputs can help mitigate the risk until an update can be performed.

Related vulnerabilities

Recent vulnerabilities recorded for node-fetch.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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