Vulnerabilities in pkg:npm/ua-parser
PACKAGECVE-2017-16086 is a HIGH denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Ua parser libraries in the npm ecosystem. The issue involves redos via long useragent header in ua-parser. Remediation is available in the latest vendor maintenance releases.
pkg:npm/ua-parser
Vulnerability advisories affecting package pkg:npm/ua-parser. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-pmg9-p9r2-6q87 | CVE-2017-16086 | HIGH | ReDoS via long UserAgent header in ua-parser |
CVE-2017-16086 at a Glance
How to Fix CVE-2017-16086
To remediate this vulnerability, upgrade all affected Ua parser 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 ua-parser@Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls ua-parser
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2017-16086, inspect your project dependencies using npm:
npm ls ua-parser
Analyze the terminal output to locate any version of Ua parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The npm ls ua-parser 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 Ua parser, 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-16086 Affected Ua parser Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ua-parser
|
npm |
≤ 0.3.5
|
|
References
Frequently Asked Questions
What is CVE-2017-16086?
Which Ua parser versions are affected?
What version fixes CVE-2017-16086?
Is ua-parser affected?
What CWE is associated with CVE-2017-16086?
How can I check npm dependencies for CVE-2017-16086?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pmg9-p9r2-6q87",
"modified" : "2021-01-08T18:20:33Z",
"published" : "2018-07-24T19:46:37Z",
"aliases" : [ "CVE-2017-16086" ],
"summary" : "ReDoS via long UserAgent header in ua-parser",
"details" : "Affected versions of `ua-parser` are vulnerable to regular expression denial of service when given a specially crafted `User-Agent` header.\n\n\n## Recommendation\n\nNo patch is currently available for this vulnerability.\n\nThe best mitigation is currently to avoid using this package, using a different, functionally equivalent package such as [useragent](https://www.npmjs.com/package/useragent).",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "ua-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.3.5"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-16086"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-pmg9-p9r2-6q87"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/316"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:49:36Z",
"nvd_published_at" : null
}
}