CVE-2026-48125
ua-parser-js: UAParser.js: Denial of Service via crafted Client Hints header
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · July 15, 2026
Updated · July 20, 2026
Description
A flaw was found in UAParser.js, a JavaScript library for detecting client information. A remote attacker can exploit this vulnerability by sending a specially crafted Sec-CH-UA-Model header when the application uses the Client Hints API. This can cause excessive CPU usage due to a regular expression denial-of-service (ReDoS) issue, leading to a denial of service for the affected application.
Statement
The Sec-CH-UA-Model header is part of the User-Agent Client Hints infrastructure. Mobile browsers send this hint to inform servers about the specific device model. Servers use the model name to tailor content, apply device-specific optimizations, or log analytics about which hardware models access a service.
A Regular Expression Denial of Service (ReDoS) vulnerability was found in the ua-parser-js npm package. By sending a crafted Sec-CH-UA-Model header to an application that calls UAParser(headers).withClientHints(), an attacker can cause the parser to spend excessive CPU time.
A single request with a ~32,000-character model value can consume over 400ms of CPU time, with parsing time growing polynomially with input length. The impact is availability only, there is no confidentiality or integrity impact.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
If you are managing web servers or Node.js applications that process user-agent information, you can defend against this attack vector using the following approaches:
- Apply header length restrictions (reverse proxy, WAF, application)
- Opt-out of Client Hints, avoid parsing the Sec-CH-UA-Model with ua-parser-js npm package
Upgrading to version 2.0.10+ mitigates this issue, by setting a maximum cap size of UA_MAX_LENGTH = 500.
CVSS / CWE
CVSS 3.1 · 5.3CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CWE-1333 · Inefficient Regular Expression Complexity