npm

The ua-parser-js npm Supply Chain Attack

Updated 5 Oct 2026 · Incident date 22 Oct 2021

ua-parser-js 0.7.29, 0.8.0 and 1.0.0 on npm were published by attackers on 22 October 2021 and ran a hidden coin miner.

The package parses browser user-agent strings, and many projects use it. The GitHub advisory states that you must treat any computer that installed or ran one of these versions as fully compromised.

What happened

An attacker took over the package account and published three releases that ran a script at install time.

  • Each release had a preinstall entry in package.json that ran preinstall.js.
  • On Windows, the script downloaded jsextension.exe, a Monero miner, from 159.148.186[.]228.
  • It also downloaded create.dll, the DanaBot banking trojan, from citationsherbe[.]at/sdd.dll and ran it with regsvr32.exe -s create.dll.
  • On Linux, the script downloaded the same miner, named jsextension. It stopped if the machine was in Russia, Ukraine, Belarus or Kazakhstan.
  • The script did nothing on macOS.

The versions went up between 16:14 and 16:25 UTC on 22 October 2021. Mandiant also lists later hijacks of coa and rc on 4 November 2021.

Affected versions

  • ua-parser-js 0.7.29, 0.8.0 and 1.0.0. The last good version of the old line is 0.7.28.
  • Patched: 0.7.30, 0.8.1 and 1.0.1.
  • coa 2.0.3, 2.0.4, 2.1.1, 2.1.3 and 3.1.3. Safe: 2.0.2.
  • rc 1.2.9, 1.3.9 and 2.3.9. Safe: 1.2.8.

Indicators of compromise

  • Files: preinstall.js, jsextension.exe, jsextension, create.dll and sdd.dll.
  • MD5 of jsextension.exe: fc724eb2894f34a3aca4b952d2f816cd.
  • MD5 of sdd.dll (DanaBot): de8b54a938ac18f15cad804d79a0e19d.
  • Download host: 159.148.186[.]228. Download domain: citationsherbe[.]at.
  • DanaBot command servers (port 443): 185.158.250[.]216, 45.11.180[.]153, 194.76.225[.]46 and 194.76.225[.]61.
  • For coa and rc: the domain pastorcryptograph[.]at.

How to check

Show every copy of the package in the tree and in the npm cache.

npm ls ua-parser-js coa rc --all
grep -rEn "ua-parser-js@(0.7.29|0.8.0|1.0.0)|\"version\": \"(0.7.29|0.8.0|1.0.0)\"" package-lock.json

If you are unsure whether a machine installed a bad version, also search it for the dropped files, jsextension, jsextension.exe and create.dll.

What to do now

  1. Upgrade to 0.7.30, 0.8.1 or 1.0.1. Check coa and rc too.
  2. If a bad version installed, treat the machine as fully compromised. Rotate every secret and key from a clean system.
  3. Remove the dropped files jsextension, jsextension.exe and create.dll. Removing the package does not remove malware that its install script placed.
  4. Run a forensic review for unauthorized access. Lock dependency versions.

What Vigilance would show

These examples show an install hold and the corresponding owner report.

Example install message

Vigilance blocked `ua-parser-js` 0.7.29. This version is too new or changed in a way Vigilance must check first.

Example owner report

Bad update

ua-parser-js 0.7.29

Installing the library now quietly downloaded and ran a program that mined coins and stole saved passwords.

See what to do now.

No security team? See who reads the alert.

Frequently asked questions

What did the malicious versions install?

On Windows they installed a Monero miner and the DanaBot banking trojan. On Linux they installed the miner.

What happened to coa and rc?

Mandiant lists later hijacks on 4 November 2021 that delivered a modified DanaBot DLL.

Sources

  1. github.com/advisories/GHSA-pjwm-rvh2-c87w
  2. cloud.google.com/blog/topics/threat-intelligence/supply-chain-node-js/
  3. github.com/faisalman/ua-parser-js/issues/536

Send this page to the person who looks after AI at your company.

Email it

More supply chain attacks

All 172 attacks in the library · npm supply chain attacks · How to prevent supply chain attacks

Check the next update before you install it

Vigilance compares the version you trust with the new one. It names the one file that gained a power the old version did not have.

Start the free 14-day trialBrowse the attack library