CVE-2021-4229 — ua-parser-js
HIGHCVE-2021-4229 is a high-severity (CVSS 8.8) CWE-912 vulnerability in ua-parser-js. A fix is available for ua-parser-js — see the affected versions and patch details below.
Embedded malware in ua-parser-js
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2021-4229.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
ua-parser-jsnpmDescription
The npm package ua-parser-js had three versions published with malicious code. Users of affected versions (0.7.29, 0.8.0, 1.0.0) should upgrade as soon as possible and check their systems for suspicious activity. See this issue for details as they unfold.
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | ua-parser-js | ≥ 0.7.29&&< 0.7.30 | 0.7.30npm install ua-parser-js@0.7.30 |
| 📦npm | ua-parser-js | ≥ 0.8.0&&< 0.8.1 | 0.8.1npm install ua-parser-js@0.8.1 |
| 📦npm | ua-parser-js | ≥ 1.0.0&&< 1.0.1 | 1.0.1npm install ua-parser-js@1.0.1 |
Affected Products
ua-parser-jsua-parser-js_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for ua-parser-js, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update ua-parser-js to 0.7.30 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-4229 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is CVE-2021-4229 in your dependencies?
Find it across npm, including transitive dependencies.