CVE-2020-28501: Regular Expression Denial of Service (ReDoS) in es6-crawler-detect

es6-crawler-detect Updated 02 Oct 2025

Summary

13/04/2021
Yes i
Moderate
5.3

CVE-2020-28501: Regular Expression Denial of Service (ReDoS) in es6-crawler-detect. Affects es6-crawler-detect versions < 3.1.3. Fixed in 3.1.3. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

es6-crawler-detect is an npm package that is used for detecting web crawlers and bots based on their user agent string. It provides a simple and efficient way to identify and handle crawler requests. However, prior to version 3.1.3, the package is vulnerable to a Regular Expression Denial of Service (ReDoS) attack. This means that an attacker can exploit the package's regular expression pattern matching to cause a denial of service by providing a specially crafted user agent string. The package does not impose any limitation on the length of the user agent string, making it susceptible to excessive backtracking and causing the application to become unresponsive.

Vulnerability Detail

The vulnerability in es6-crawler-detect arises from the lack of user agent string length limitation in the regular expression pattern matching. An attacker can send a maliciously crafted user agent string that triggers excessive backtracking in the regular expression engine. This can lead to a denial of service condition where the application becomes unresponsive and may require manual intervention to recover. The impact of this vulnerability can range from temporary unavailability of the affected application to a complete system outage. The Common Vulnerability Scoring System (CVSS) score for this vulnerability is 5.3, indicating a moderate severity level.

How To Fix

Minimum fixed version

3.1.3

This is the first release that contains the fix.

npm install es6-crawler-detect@3.1.3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the package is not immediately feasible, a temporary workaround can be implemented by manually imposing a limitation on the length of the user agent string in the application's code. This can be done by validating the length of the user agent string before passing it to the es6-crawler-detect package. Here is an example of how this can be done in JavaScript:

const userAgent = req.headers['user-agent'];
if (userAgent.length > MAX_USER_AGENT_LENGTH) {
  // Handle the user agent string length limit
}

In this example, MAX_USER_AGENT_LENGTH is a constant that defines the maximum allowed length of the user agent string. If the length exceeds this limit, appropriate actions can be taken to mitigate the vulnerability.

Conclusion

The es6-crawler-detect package prior to version 3.1.3 is vulnerable to a Regular Expression Denial of Service (ReDoS) attack. This can be exploited by an attacker to cause a denial of service condition in the affected application. To mitigate this vulnerability, it is recommended to update the package to version 3.1.3 or later. If immediate update is not possible, a temporary workaround can be implemented by imposing a limitation on the length of the user agent string. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for es6-crawler-detect →

Share this vulnerability

FAQ

es6-crawler-detect is an npm package used for identifying web crawlers and bots based on their user agent string. It provides a convenient way to handle crawler requests in web applications.

A Regular Expression Denial of Service (ReDoS) attack is a type of vulnerability where an attacker can exploit the backtracking behavior of regular expression pattern matching to cause a denial of service. By providing a specially crafted input, the attacker can trigger excessive backtracking, leading to a significant increase in the time taken to process the input and potentially causing the application to become unresponsive.

The impact of this vulnerability can range from temporary unavailability of the affected application to a complete system outage. An attacker can send a malicious user agent string that triggers excessive backtracking, causing the application to become unresponsive and requiring manual intervention to recover.

To fix this vulnerability, it is recommended to update the es6-crawler-detect package to version 3.1.3 or later. This version includes a fix that imposes a limitation on the length of the user agent string, preventing excessive backtracking. Developers should update their application's dependencies to use the patched version of the package.

If updating the package is not immediately feasible, a temporary workaround can be implemented by manually imposing a limitation on the length of the user agent string in the application's code. This can be done by validating the length of the user agent string before passing it to the es6-crawler-detect package.

How To Fix

Minimum fixed version

3.1.3

This is the first release that contains the fix.

npm install es6-crawler-detect@3.1.3

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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