Vulnerabilities in pkg:npm/ua-parser-js
PACKAGECVE-2026-48125 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Ua parser js libraries in the npm ecosystem. The issue involves unbounded `sec-ch-ua-model` parsing can trigger redos in `withclienthints()`. Remediation is available by upgrading affected packages to version 2.0.10.
pkg:npm/ua-parser-js
Vulnerability advisories affecting package pkg:npm/ua-parser-js. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-9h5v-pfqq-x599 | CVE-2026-48125 | MODERATE | UAParser.js: Unbounded `Sec-CH-UA-Model` parsing can trigger ReDoS in `withClientHints()` |
| GHSA-pjwm-rvh2-c87w | CVE-2021-4229 | HIGH | Embedded malware in ua-parser-js |
| GHSA-236c-vhj4-gfxg | - | HIGH | Duplicate Advisory: Embedded malware in ua-parser-js |
| GHSA-fhg7-m89q-25r3 | CVE-2022-25927 | HIGH | ReDoS Vulnerability in ua-parser-js version |
| GHSA-394c-5j6w-4xmx | CVE-2020-7793 | HIGH | ua-parser-js Regular Expression Denial of Service vulnerability |
| GHSA-662x-fhqg-9p8v | CVE-2020-7733 | HIGH | Regular Expression Denial of Service in ua-parser-js |
| GHSA-78cj-fxph-m83p | CVE-2021-27292 | HIGH | Regular Expression Denial of Service (ReDoS) in ua-parser-js |
CVE-2026-48125 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2026-48125
To remediate this vulnerability, upgrade all affected Ua parser js dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install ua-parser-js@2.0.10
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls ua-parser-js
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-48125, inspect your project dependencies using npm:
npm ls ua-parser-js
Analyze the terminal output to locate any version of Ua parser js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.10), your application is affected.
Note: The npm ls ua-parser-js command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Ua parser js, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-48125 Affected Ua parser js Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ua-parser-js
|
npm |
≥ 2.0.1
< 2.0.10
|
2.0.10
|
References
Frequently Asked Questions
What is CVE-2026-48125?
Which Ua parser js versions are affected?
What version fixes CVE-2026-48125?
Is ua-parser-js affected?
What is the CVSS score of CVE-2026-48125?
What CWE is associated with CVE-2026-48125?
How can I check npm dependencies for CVE-2026-48125?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9h5v-pfqq-x599",
"modified" : "2026-06-15T20:15:02Z",
"published" : "2026-06-15T20:15:02Z",
"aliases" : [ "CVE-2026-48125" ],
"summary" : "UAParser.js: Unbounded `Sec-CH-UA-Model` parsing can trigger ReDoS in `withClientHints()`",
"details" : "### Summary\n\nA 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](https://github.com/faisalman/ua-parser-js/blob/2.0.9/src/main/ua-parser.js#L615):\n\n```js\n/ ([\\w ]+) miui\\/v?\\d/i\n```\n\nUnlike when using the `User-Agent` value, which has a hard limit of `UA_MAX_LENGTH = 500`, when using Client Hints, values are copied without a length limit before being passed into regex parsing.\n\n### PoC\n\n```js\nconst { UAParser } = require('ua-parser-js');\n\nconst headers = {\n 'sec-ch-ua-platform': '\"Android\"',\n 'sec-ch-ua-mobile': '?1',\n 'sec-ch-ua-model': '\"' + 'A '.repeat(25000) + '\"'\n};\n\nconst t0 = process.hrtime.bigint();\nUAParser(headers).withClientHints();\nconst ms = Number(process.hrtime.bigint() - t0) / 1e6;\n\nif (ms > 100) {\n console.log('Potential ReDoS');\n}\n```\n\n### Impact\n\nThis 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.\n\n### Affected Versions\n\n`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`.\n\n### Patches\n\nA 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.\n\n### References\n\n- [Regular expression Denial of Service - ReDoS (OWASP)](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)\n\n### Credits\n\nThanks to [@sondt99](https://github.com/sondt99), who first reported the issue.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "ua-parser-js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.1"
}, {
"fixed" : "2.0.10"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/faisalman/ua-parser-js/security/advisories/GHSA-9h5v-pfqq-x599"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/faisalman/ua-parser-js"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333", "CWE-400" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-15T20:15:02Z",
"nvd_published_at" : null
}
}