{"id":"CVE-2026-48125","aliases":["CVE-2026-48125","GHSA-9h5v-pfqq-x599"],"related":[],"kind":"vulnerability","state":"published","title":"UAParser.js: Unbounded `Sec-CH-UA-Model` parsing can trigger ReDoS in `withClientHints()`","summary":"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 UA_MAX_LENGTH limit used for User-Agent values. This issue is fixed in version 2.0.10.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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 UA_MAX_LENGTH limit used for User-Agent values. This issue is fixed in version 2.0.10.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"UAParser.js es una biblioteca JavaScript para detectar navegadores, sistemas operativos, CPUs y dispositivos a partir de datos de user-agent. Desde la 2.0.1 hasta la 2.0.10, existe una vulnerabilidad de denegación de servicio por expresión regular al usar la API de Client Hints. Al enviar un encabezado Sec-CH-UA-Model manipulado a una aplicación que llama a UAParser(headers).withClientHints(), un atacante puede causar un tiempo de CPU excesivo debido a un retroceso catastrófico en la expresión regular del dispositivo porque los valores de Client Hints se copian sin el límite UA_MAX_LENGTH utilizado para los valores de User-Agent. Este problema está solucionado en la versión 2.0.10.","source":"nvd"}],"published":"2026-06-15T20:15:02.000Z","modified":"2026-10-24T21:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-400","CWE-1333"],"affected":[{"ranges":[{"version":">= 2.0.1, < 2.0.10","status":"affected"}],"vendor":"faisalman","product":"ua-parser-js","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.0.1","status":"affected","fixed":"2.0.10"}],"ecosystem":"npm","package":"ua-parser-js","purl":"pkg:npm/ua-parser-js","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"2.0.1","fixed":"2.0.10"}],"vendor":"ua-parser-js_project","product":"ua-parser-js","cpe":"cpe:2.3:a:ua-parser-js_project:ua-parser-js:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/faisalman/ua-parser-js/security/advisories/GHSA-9h5v-pfqq-x599","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/faisalman/ua-parser-js/commit/90354d3458495628b1d3ba68a9d76673e6d14fc5","tags":["patch","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/faisalman/ua-parser-js/releases/tag/2.0.10","tags":["release-notes","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/faisalman/ua-parser-js","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-07-15T12:55:17.247Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-48125","url":"https://www.cve.org/CVERecord?id=CVE-2026-48125","licence":"CVE Terms of Use","modified":"2026-07-15T12:55:20.077Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9h5v-pfqq-x599","url":"https://github.com/advisories/GHSA-9h5v-pfqq-x599","licence":"CC-BY-4.0","modified":"2026-06-15T20:41:40.397Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-48125","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-48125","licence":"Public domain","modified":"2026-10-24T21:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:28.216Z","epss":{"score":0.00445,"percentile":0.40405,"date":"2026-12-01T12:00:22.000Z"}}