CVE-2017-16030: useragent - ReDoS via long UserAgent header

useragent Updated 02 Oct 2025

Summary

24/07/2018
Yes i
High
Not published

CVE-2017-16030: ReDoS via long UserAgent header in useragent. Affects useragent versions < 2.1.13. Fixed in 2.1.13. 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

The useragent package is an npm package that provides a way to parse and analyze user agent strings. It is commonly used in web applications to extract information about the client's browser, operating system, and device. The package is vulnerable to a regular expression denial of service (ReDoS) attack when parsing an excessively long User-Agent header.

Vulnerability Detail

The vulnerability arises when the useragent package attempts to parse a User-Agent header that is arbitrarily long. This can lead to a ReDoS attack, where an attacker can craft a malicious User-Agent header that causes the regular expression used for parsing to take an excessive amount of time to complete. This can result in a denial of service condition, as the server becomes unresponsive while processing the malicious input. The impact of this vulnerability can range from temporary service disruption to a complete server crash.

How To Fix

Minimum fixed version

2.1.13

This is the first release that contains the fix.

npm install useragent@2.1.13

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

Workaround

If updating the useragent package is not immediately feasible, a temporary workaround can be implemented by validating and limiting the length of the User-Agent header on the server side. This can be done by setting a maximum allowed length for the header and rejecting requests that exceed this limit. However, it is important to note that this workaround only mitigates the impact of the vulnerability and does not address the root cause.

Conclusion

The useragent package is vulnerable to a ReDoS attack when parsing an excessively long User-Agent header. To mitigate this vulnerability, it is crucial to update the package to version 2.1.13 or later. If immediate updating is not possible, implementing a temporary workaround by validating and limiting the length of the User-Agent header can help mitigate the impact. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for useragent →

Share this vulnerability

FAQ

A ReDoS attack, short for Regular Expression Denial of Service, is a type of vulnerability where an attacker can exploit the way a regular expression is processed to cause a significant delay or hang in the execution of the regex engine. This can lead to a denial of service condition, as the targeted system becomes unresponsive while processing the malicious input.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. The playground allows you to analyze your package-lock.json file and provides real-time alerts for open-source vulnerabilities in your software.

The consequences of this vulnerability can vary depending on the specific application and server configuration. In some cases, it may result in temporary service disruption, where the server becomes unresponsive while processing the malicious input. In more severe cases, it can lead to a complete server crash, causing extended downtime and potential loss of data.

While there is a proof of concept provided for this vulnerability, there is no known public exploit available at this time. However, it is important to address this vulnerability promptly to mitigate the risk of potential exploitation.

The primary recommended mitigation for this vulnerability is to update the useragent package to the latest version. Additionally, implementing proper input validation and sanitization practices can help reduce the risk of various types of input-based vulnerabilities, including ReDoS attacks.

Related vulnerabilities

Recent vulnerabilities recorded for useragent.

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

Minimum fixed version

2.1.13

This is the first release that contains the fix.

npm install useragent@2.1.13

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