CVE-2017-16030: Useragent Denial of Service Vulnerability
HIGHCVE-2017-16030 is a HIGH denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Useragent libraries in the npm ecosystem. The issue involves redos via long useragent header in useragent. Remediation is available by upgrading affected packages to version 2.1.13.
CVE-2017-16030 at a Glance
How to Fix CVE-2017-16030
To remediate this vulnerability, upgrade all affected Useragent dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install useragent@2.1.13
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls useragent
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2017-16030, inspect your project dependencies using npm:
npm ls useragent
Analyze the terminal output to locate any version of Useragent in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.13), your application is affected.
Note: The npm ls useragent command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Useragent, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2017-16030 Affected Useragent Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
useragent
|
npm |
< 2.1.13
|
2.1.13
|
References
Frequently Asked Questions
What is CVE-2017-16030?
Which Useragent versions are affected?
What version fixes CVE-2017-16030?
Is useragent affected?
What CWE is associated with CVE-2017-16030?
How can I check npm dependencies for CVE-2017-16030?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pjmx-9xr3-82qr",
"modified" : "2023-09-06T20:07:59Z",
"published" : "2018-07-24T19:59:13Z",
"aliases" : [ "CVE-2017-16030" ],
"summary" : "ReDoS via long UserAgent header in useragent",
"details" : "Affected versions of `useragent` are vulnerable to regular expression denial of service when an arbitrarily long `User-Agent` header is parsed.\n\n\n## Proof of Concept\n```js\nvar useragent = require('useragent');\n\nvar badUserAgent = 'MSIE 0.0'+Array(900000).join('0')+'XBLWP';\nvar request = 'GET / HTTP/1.1\\r\\nUser-Agent: ' + badUserAgent + '\\r\\n\\r\\n';\nconsole.log(useragent.parse(request));\n```\n\n\n## Recommendation\n\nUpdate to version 2.1.13 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "useragent"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.13"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.1.12"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-16030"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-pjmx-9xr3-82qr"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/312"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:49:26Z",
"nvd_published_at" : null
}
}