CVE-2026-48125: UAParser.js: Unbounded `Sec-CH-UA-Model` parsing can trigger ReDoS in `withClientHints()`

Published Jun 15, 2026
·
Updated

Summary

A regular expression denial-of-service (ReDoS) vulnerability has been discovered in ua-parser-js when using the Client Hints API. 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 due to catastrophic backtracking in the device regex:

js / ([\w ]+) miui\/v?\d/i

Unlike when using the User-Agent value, which has a hard limit of UAMAXLENGTH = 500, when using Client Hints, values are copied without a length limit before being passed into regex parsing.

PoC

js const { UAParser } = require('ua-parser-js');

const headers = { 'sec-ch-ua-platform': '"Android"', 'sec-ch-ua-mobile': '?1', 'sec-ch-ua-model': '"' + 'A '.repeat(25000) + '"' };

const t0 = process.hrtime.bigint(); UAParser(headers).withClientHints(); const ms = Number(process.hrtime.bigint() - t0) / 1e6;

if (ms > 100) { console.log('Potential ReDoS'); }

Impact

This vulnerability allows an unauthenticated attacker to trigger a denial-of-service condition in any server-side application that uses UAParser(headers).withClientHints(). 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.

Affected Versions

ua-parser-js versions >=2.0.1, <=2.0.9 are affected. The withClientHints() API is not present in version 0.7.x or 1.x.

Patches

A patch has been released to fix the vulnerable regular expression and limit the Client Hints input. Users should update to version 2.0.10 or later.

References

- Regular expression Denial of Service - ReDoS (OWASP)

Credits

Thanks to @sondt99, who first reported the issue.

Other sources

UAParser.js is a JavaScript library to detect browsers, operating systems, CPUs, and devices from user-agent data. From 2.0.1 until 2.0.10, a regular expression denial-of-service vulnerability exists when using the Client Hints API. By sending a crafted Sec-CH-UA-Model header to an application that calls UAParser(headers).withClientHints(), an attacker can cause excessive CPU time due to catastrophic backtracking in the device regex because Client Hints values are copied without the UAMAXLENGTH limit used for User-Agent values. This issue is fixed in version 2.0.10.

MITRE

Affected Software

2 affected componentsFixes available
npm/ua-parser-js>=2.0.1<2.0.10
2.0.10
Ua-parser-js Project Ua-parser-js Node.js>=2.0.1<2.0.10

Event History

Jun 15, 2026
Advisory Published
via GitHub·08:15 PM
Data Sourced
via GitHub·08:15 PM
DescriptionSeverityWeaknessAffected Software
Jul 14, 2026
CVE Published
via MITRE·08:54 PM
Data Sourced
via MITRE·08:54 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-48125?

The severity of CVE-2026-48125 is rated as medium with a score of 5.3.

2

How can CVE-2026-48125 affect my application?

CVE-2026-48125 can cause a regular expression denial-of-service (ReDoS) attack, potentially leading to application downtime.

3

How do I fix CVE-2026-48125?

To fix CVE-2026-48125, apply the available patch provided in the latest update for ua-parser-js.

4

What software versions are affected by CVE-2026-48125?

CVE-2026-48125 affects the ua-parser-js library used in npm projects.

5

What is the nature of the attack for CVE-2026-48125?

CVE-2026-48125 involves sending a crafted `Sec-CH-UA-Model` header to exploit the parser in `withClientHints()`.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203