CVE-2020-7733: Regular Expression Denial of Service in ua-parser-js
Summary
CVE-2020-7733: Regular Expression Denial of Service in ua-parser-js. Affects ua-parser-js versions < 0.7.22. Fixed in 0.7.22. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
ua-parser-js is an npm package that provides a JavaScript library for parsing user agent strings. It is commonly used to extract information about the user's browser, operating system, and device. The package is widely used in web development projects to enhance user experience and customize content based on the user's device characteristics. However, versions prior to 0.7.22 are vulnerable to a Regular Expression Denial of Service (ReDoS) attack. This vulnerability arises from a regex pattern used to identify Redmi Phones and Mi Pad Tablets user agents.
Vulnerability Detail
The vulnerability in ua-parser-js allows an attacker to exploit the regex pattern used for identifying Redmi Phones and Mi Pad Tablets user agents, leading to a Regular Expression Denial of Service (ReDoS) attack. By providing a specially crafted user agent string, an attacker can cause the regex pattern to exhibit exponential time complexity, resulting in a denial of service condition. This can lead to resource exhaustion, impacting the availability of the application or system. The severity of this vulnerability is rated as HIGH with a CVSS score of 7.5.
How To Fix
Latest published version: 2.0.10 as of 22 Oct 2026
npm install ua-parser-js@2.0.10
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
0.7.22
This is the first release that contains the fix.
npm install ua-parser-js@0.7.22
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is essential to update the ua-parser-js package to the fixed version to ensure the security of the application.
Conclusion
The ua-parser-js package prior to version 0.7.22 is vulnerable to a Regular Expression Denial of Service (ReDoS) attack. It is crucial to update the package to the fixed version to mitigate this vulnerability. For further support on vulnerability remediation, contact DevNack.com.
See every vulnerability recorded for ua-parser-js →
FAQ
ua-parser-js is an npm package used for parsing user agent strings in JavaScript. It helps extract information about the user's browser, operating system, and device.
A Regular Expression Denial of Service (ReDoS) attack is a type of vulnerability where a maliciously crafted input can cause a regular expression pattern to exhibit exponential time complexity. This can lead to a denial of service condition, impacting the availability of the application or system.
This vulnerability affects ua-parser-js versions prior to 0.7.22. By providing a specially crafted user agent string, an attacker can trigger a Regular Expression Denial of Service (ReDoS) attack, leading to resource exhaustion and potential denial of service.
This vulnerability is rated as HIGH with a CVSS score of 7.5.
To fix this vulnerability, update the ua-parser-js package to version 0.7.22 or later. Run the command 'npm install ua-parser-js@0.7.22' in your project's root directory.
References
Related vulnerabilities
Recent vulnerabilities recorded for ua-parser-js.