Malicious Code in ua-parser-js npm Package

ua-parser-js Updated 02 Oct 2025

Summary

22/10/2021
HIGH
Yes i
High
8.8

GHSA-pjwm-rvh2-c87w: Embedded malware in ua-parser-js. Affects ua-parser-js across 3 version ranges.

>= 0.7.29, < 0.7.30 >= 0.8.0, < 0.8.1 >= 1.0.0, < 1.0.1

Fixed in 0.7.30, 0.8.1 or 1.0.1, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

ua-parser-js is an npm package used for parsing user-agent strings in JavaScript applications. It provides information about the user's browser, operating system, and device. The package is widely used in web development projects to enhance user experience and perform browser-specific optimizations. However, several versions of ua-parser-js (0.7.29, 0.8.0, 1.0.0) were found to contain embedded malware, compromising the security of systems that have this package installed.

Vulnerability Detail

The npm package ua-parser-js had three versions (0.7.29, 0.8.0, 1.0.0) published with malicious code. This means that any computer with these versions installed or running should be considered fully compromised. The malicious code can give control of the computer to an outside entity, potentially leading to unauthorized access, data theft, or further exploitation. It is crucial to upgrade to the fixed versions (0.7.30, 0.8.1, 1.0.1) immediately and check for any suspicious activity on the system.

How To Fix

Latest published version: 2.0.10 as of 22 Oct 2026

npm install ua-parser-js@2.0.10

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 0.7.29, < 0.7.30 0.7.30
    npm install ua-parser-js@0.7.30
  • >= 0.8.0, < 0.8.1 0.8.1
    npm install ua-parser-js@0.8.1
  • >= 1.0.0, < 1.0.1 1.0.1
    npm install ua-parser-js@1.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Conclusion

The ua-parser-js npm package has been found to contain embedded malware in versions 0.7.29, 0.8.0, and 1.0.0. It is crucial to upgrade to the fixed versions (0.7.30, 0.8.1, 1.0.1) immediately and check for any suspicious activity on the system. Rotate all secrets and keys stored on the compromised computer and consider removing the affected package. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for ua-parser-js →

Share this vulnerability

FAQ

ua-parser-js is an npm package used for parsing user-agent strings in JavaScript applications. It provides information about the user's browser, operating system, and device.

The affected versions are 0.7.29, 0.8.0, and 1.0.0.

You can check your project's package.json or package-lock.json file to see the installed version of ua-parser-js.

The malicious code in the affected versions of ua-parser-js can give control of the compromised computer to an outside entity. This can lead to unauthorized access, data theft, or further exploitation.

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. It is recommended to thoroughly scan the system and take necessary security measures.

Related vulnerabilities

Recent vulnerabilities recorded for ua-parser-js.

How To Fix

Latest published version: 2.0.10 as of 22 Oct 2026

npm install ua-parser-js@2.0.10

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 0.7.29, < 0.7.30 0.7.30
    npm install ua-parser-js@0.7.30
  • >= 0.8.0, < 0.8.1 0.8.1
    npm install ua-parser-js@0.8.1
  • >= 1.0.0, < 1.0.1 1.0.1
    npm install ua-parser-js@1.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback