Regular Expression Denial of Service (ReDoS)
Description
ua-parser-js before 0.7.23 contains multiple Regular Expression Denial of Service (ReDoS) vulnerabilities in its user-agent parsing regexes.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
ua-parser-js before 0.7.23 contains multiple Regular Expression Denial of Service (ReDoS) vulnerabilities in its user-agent parsing regexes.
Vulnerability
Overview
The ua-parser-js library, versions prior to 0.7.23, is vulnerable to Regular Expression Denial of Service (ReDoS) due to inefficient regular expressions used for parsing user-agent strings [1]. The commit that fixes the issue shows modifications to several regex patterns, including those for Opera, Trident, Safari, and others, which were susceptible to catastrophic backtracking [2].
Exploitation
An attacker can exploit this vulnerability by sending a specially crafted, long user-agent string to an application that uses the vulnerable library to parse it. No authentication is required, as the attack can be performed remotely over the network. The crafted input causes the regex engine to take an exponential amount of time to process, effectively blocking the event loop in Node.js environments [3][4].
Impact
Successful exploitation leads to a Denial of Service (DoS) condition, making the application unresponsive to legitimate requests. Since the library is widely used for browser detection in web applications, this can affect a broad range of services [1].
Mitigation
The vulnerability is fixed in version 0.7.23 of ua-parser-js. Users should upgrade immediately. No workarounds are available other than updating the library [2].
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
ua-parser-jsnpm | < 0.7.23 | 0.7.23 |
Affected products
1Patches
16d1f26df051bFix ReDoS vulnerabilities reported by Snyk
1 file changed · +14 −14
src/ua-parser.js+14 −14 modified@@ -222,7 +222,7 @@ // Presto based /(opera\smini)\/([\w\.-]+)/i, // Opera Mini - /(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet + /(opera\s[mobiletab]{3,6}).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet /(opera).+version\/([\w\.]+)/i, // Opera > 9.80 /(opera)[\/\s]+([\w\.]+)/i // Opera < 9.80 ], [NAME, VERSION], [ @@ -252,7 +252,7 @@ /(konqueror)\/([\w\.]+)/i // Konqueror ], [[NAME, 'Konqueror'], VERSION], [ - /(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11 + /(trident).+rv[:\s]([\w\.]{1,9}).+like\sgecko/i // IE11 ], [[NAME, 'IE'], VERSION], [ /(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i // Microsoft Edge @@ -362,13 +362,13 @@ /fxios\/([\w\.-]+)/i // Firefox for iOS ], [VERSION, [NAME, 'Firefox']], [ - /version\/([\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari + /version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i // Mobile Safari ], [VERSION, [NAME, 'Mobile Safari']], [ - /version\/([\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile + /version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i // Safari & Safari Mobile ], [VERSION, NAME], [ - /webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Google Search Appliance on iOS + /webkit.+?(gsa)\/([\w\.]+)\s.*(mobile\s?safari|safari)(\/[\w\.]+)/i // Google Search Appliance on iOS ], [[NAME, 'GSA'], VERSION], [ /webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Safari < 3.0 @@ -387,7 +387,7 @@ // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix /(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i, // Other Firefox-based - /(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla + /(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i, // Mozilla // Other /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i, @@ -487,7 +487,7 @@ /(sprint\s(\w+))/i // Sprint Phones ], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [ - /(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i, // HTC + /(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i, // HTC /(zte)-(\w*)/i, // ZTE /(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony @@ -591,13 +591,13 @@ ], [MODEL, [VENDOR, 'Google'], [TYPE, MOBILE]], [ /android.+;\s(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models - /android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i, // Xiaomi Hongmi - /android.+(redmi[\s\-_]*(?:note|k)?(?:[\s_]?[\w\s]+))(?:\s+build|\))/i, + /android.+(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i, // Xiaomi Hongmi + /android.+(redmi[\s\-_]?(?:note|k)?(?:[\s_]?[\w\s]+))(?:\sbuild|\))/i, // Xiaomi Redmi - /android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i + /android.+(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i // Xiaomi Mi ], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [ - /android.+(mi[\s\-_]*(?:pad)(?:[\s_]?[\w\s]+))(?:\s+build|\))/i // Mi Pad tablets + /android.+(mi[\s\-_]?(?:pad)(?:[\s_]?[\w\s]+))(?:\sbuild|\))/i // Mi Pad tablets ],[[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, TABLET]], [ /android.+;\s(m[1-5]\snote)\sbuild/i // Meizu ], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [ @@ -611,7 +611,7 @@ /android.+[;\/]\s*(RCT[\d\w]+)\s+build/i // RCA Tablets ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [ - /android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i // Dell Venue Tablets + /android.+[;\/\s](Venue[\d\s]{2,7})\s+build/i // Dell Venue Tablets ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [ /android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i // Verizon Tablet @@ -669,8 +669,8 @@ /android.+[;\/]\s*TU_(1491)\s+build/i // Rotor Tablets ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [ - /android.+(KS(.+))\s+build/i // Amazon Kindle Tablets - ], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [ + //android.+(KS(.+))\s+build/i // Amazon Kindle Tablets + //], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [ /android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i // Gigaset Tablets ], [VENDOR, MODEL, [TYPE, TABLET]], [
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- github.com/advisories/GHSA-394c-5j6w-4xmxghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-7793ghsaADVISORY
- cert-portal.siemens.com/productcert/pdf/ssa-637483.pdfghsax_refsource_CONFIRMWEB
- github.com/faisalman/ua-parser-js/commit/6d1f26df051ba681463ef109d36c9cf0f7e32b18ghsax_refsource_MISCWEB
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWERGITHUBFAISALMAN-1050388ghsax_refsource_MISCWEB
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1050387ghsax_refsource_MISCWEB
- snyk.io/vuln/SNYK-JS-UAPARSERJS-1023599ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.