CVE-2022-25927:
ReDoS Vulnerability in ua-parser-js version
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.7945%
CWE
Published
1/24/2023
Updated
6/21/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
ua-parser-js | npm | < 0.7.33 | 0.7.33 |
ua-parser-js | npm | >= 0.8.0, < 1.0.33 | 1.0.33 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The commit diff shows removal of the trailing whitespace regex in trim(), with the commit message explicitly stating it was vulnerable. The CVE description and Snyk PoC demonstrate how crafted long inputs to this function trigger ReDoS. The regex pattern /\s\s*$/ is known to be inefficient as it creates redundant backtracking possibilities (equivalent to \s+$ but with worse performance characteristics). The function's position before length truncation allowed attackers to bypass input size protections.