CVE-2022-25927: ReDoS Vulnerability in ua-parser-js

ua-parser-js Updated 02 Oct 2025

Summary

24/01/2023
Yes i
High
7.5

CVE-2022-25927: ReDoS Vulnerability in ua-parser-js version. Affects ua-parser-js across 2 version ranges.

< 0.7.33 >= 0.8.0, < 1.0.33

Fixed in 0.7.33 or 1.0.33, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-25927 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

ua-parser-js is an open-source library used for parsing user-agent strings in JavaScript. It provides a way to extract information about the user's browser, operating system, and device from the user-agent string. This library is commonly used in web applications to customize the user experience based on the user's device and browser capabilities. However, versions of ua-parser-js prior to 0.7.33 / 1.0.33 are vulnerable to a regular expression denial of service (ReDoS) attack.

Vulnerability Detail

The ReDoS vulnerability in ua-parser-js allows an attacker to craft a malicious user-agent string with a specific pattern that can cause the library to enter into an infinite loop, consuming excessive CPU resources and resulting in a denial of service (DoS) condition. This vulnerability bypasses the library's input limit prevention mechanism, allowing an attacker to exploit it by sending a very long user-agent string. The impact of this vulnerability is a prolonged processing time, potentially leading to a complete unresponsiveness of the affected application.

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 versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 0.7.33 0.7.33
    npm install ua-parser-js@0.7.33
  • >= 0.8.0, < 1.0.33 1.0.33
    npm install ua-parser-js@1.0.33

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If updating ua-parser-js is not immediately feasible, a temporary workaround can be implemented by implementing input validation and limiting the length of the user-agent string processed by the library. This can be done by truncating or rejecting excessively long user-agent strings before passing them to ua-parser-js. However, this workaround may impact the accuracy of the parsed user-agent information.

Conclusion

The ReDoS vulnerability in ua-parser-js can be mitigated by updating the library to version 0.7.33 or 1.0.33 or later. It is important to promptly apply the patch to ensure the proper functioning of the user-agent parsing functionality and prevent potential denial of service attacks. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for ua-parser-js →

Share this vulnerability

FAQ

ua-parser-js is an open-source library used for parsing user-agent strings in JavaScript. It provides a way to extract information about the user's browser, operating system, and device from the user-agent string.

A ReDoS vulnerability, short for regular expression denial of service, occurs when a regular expression pattern can be exploited to cause the matching algorithm to enter into an infinite loop, resulting in excessive CPU usage and a denial of service condition.

The impact of this vulnerability is a prolonged processing time and potential unresponsiveness of the affected application. An attacker can exploit this vulnerability by sending a specially crafted user-agent string, causing the ua-parser-js library to consume excessive CPU resources.

To fix this vulnerability, update ua-parser-js to version 0.7.33 or 1.0.33 or later. These versions include a patch that removes the vulnerable regular expression.

If immediate updating of ua-parser-js is not possible, a temporary workaround is to implement input validation and limit the length of the user-agent string processed by the library. However, this workaround may affect the accuracy of the parsed user-agent information.

Related vulnerabilities

Recent vulnerabilities recorded for ua-parser-js.

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 versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 0.7.33 0.7.33
    npm install ua-parser-js@0.7.33
  • >= 0.8.0, < 1.0.33 1.0.33
    npm install ua-parser-js@1.0.33

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback