CVE-2017-16030 — useragent
CVE-2017-16030 is a Uncontrolled Resource Consumption vulnerability in useragent. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for useragent — see the affected versions and patch details below.
ReDoS via long UserAgent header in useragent
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
useragentReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.
Description
Affected versions of useragent are vulnerable to regular expression denial of service when an arbitrarily long User-Agent header is parsed.
Proof of Concept
var useragent = require('useragent');
var badUserAgent = 'MSIE 0.0'+Array(900000).join('0')+'XBLWP';
var request = 'GET / HTTP/1.1\r\nUser-Agent: ' + badUserAgent + '\r\n\r\n';
console.log(useragent.parse(request));
Recommendation
Update to version 2.1.13 or later.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | useragent | all versions | 2.1.13npm install useragent@2.1.13 |
Affected Products
useragentuseragent_projectResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for useragent, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update useragent to 2.1.13 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2017-16030 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is CVE-2017-16030 in your dependencies?
Find it across npm, including transitive dependencies.