Vulnerabilities in pkg:npm/ua-parser

PACKAGE
Advisory Identifier: GHSA-pmg9-p9r2-6q87
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/ua-parser

1 Known Advisory Record(s)

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

CVE Identifier CVE-2017-16086
GHSA Identifier GHSA-pmg9-p9r2-6q87
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Ua parser
Package Ecosystem npm
Published Date
Last Updated

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.

ua-parser fixed: Latest secure release
npm install ua-parser@Latest secure release
Verify Direct and Transitive Dependencies

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

Affected versions of `ua-parser` are vulnerable to regular expression denial of service when given a specially crafted `User-Agent` header. ## Recommendation No patch is currently available for this vulnerability. The best mitigation is currently to avoid using this package, using a different, functionally equivalent package such as [useragent](https://www.npmjs.com/package/useragent).

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?
CVE-2017-16086 is a security vulnerability in Ua parser involving ReDoS via long UserAgent header in ua-parser under CWE-400: Uncontrolled Resource Consumption.
Which Ua parser versions are affected?
Affected versions include releases prior to current release patches across affected packages: ua-parser.
What version fixes CVE-2017-16086?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is ua-parser affected?
Yes, ua-parser is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2017-16086?
CVE-2017-16086 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2017-16086?
Run the dependency tree command: 'npm ls ua-parser'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}