What’s Vulnerable › Vulnerabilities
CVE-2021-27292: Regular Expression Denial of Service (ReDoS) in ua-parser-js
- Severity: high (CVSS 7.5 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 3.4% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2021-03-17 · updated 2026-06-17
Description
ua-parser-js >= 0.7.14, fixed in 0.7.24, uses a regular expression which is vulnerable to denial of service. If an attacker sends a malicious User-Agent header, ua-parser-js will get stuck processing it for an extended period of time.
Affected products
- ua-parser-js: from 0.7.14 before 0.7.24 — fixed in 0.7.24
- Npm Ua-Parser-Js: from 0.7.14 before 0.7.24 — fixed in 0.7.24
How to fix
Upgrade to a fixed version: ua-parser-js 0.7.24; Npm Ua-Parser-Js 0.7.24. Check the vendor advisory for mitigations.
References
- https://gist.github.com/b-c-ds/6941d80d6b4e694df4bc269493b7be76
- https://github.com/faisalman/ua-parser-js/commit/809439e20e273ce0d25c1d04e111dcf6011eb566
- https://github.com/pygments/pygments/commit/2e7e8c4a7b318f4032493773732754e418279a14
- https://gist.github.com/b-c-ds/6941d80d6b4e694df4bc269493b7be76
- https://github.com/faisalman/ua-parser-js/commit/809439e20e273ce0d25c1d04e111dcf6011eb566
- https://github.com/pygments/pygments/commit/2e7e8c4a7b318f4032493773732754e418279a14
Get alerted when CVE-2021-27292 or the next vulnerability affects your stack