Open Source ·
ua-parser-js hijack shipped malware
The maintainer's npm account was compromised, allowing attackers to publish malicious versions of ua-parser-js, a library embedded across millions of weekly installs.
ua-parser-js sat low in the stack and high in the graph. It parsed user-agent strings. Most applications did not depend on it by choice; they received it through other packages. On October 22, 2021, a hijacked npm account published malicious versions 0.7.29, 0.8.0, and 1.0.0 under the real package name.
The delivery was the install script. Windows and Linux hosts that installed the poisoned versions could fetch and run additional binaries. The payload attempted credential theft, including OS passwords, browser cookies, and and also installed cryptomining malware.
The package made the platform split explicit. The poisoned archives carried preinstall scripts and binaries with names such as jsextension, jsextension.exe, create.dll, and sdd.dll, giving the attacker different paths for Linux and Windows machines while keeping the npm package coordinate unchanged.
The response matched the trust failure. GitHub's advisory told users to treat affected machines as fully compromised and rotate secrets from clean hosts. The lesson was simple: a parser with millions of weekly downloads is infrastructure, even when no one thinks of it that way.
Notes
- create.dll and sdd.dll are the same file: the payload fetched https://citationsherbe.at/sdd.dll and saved it locally as create.dll. They are not two separate binaries.
- Platform behaviour differed. preinstall.js no-ops on macOS and preinstall.sh aborts where freegeoip.app places the host in RU, UA, BY or KZ; the Windows batch file had no such check.
- Credential theft was Windows-only, and Linux hosts received only the miner. The removed 0.7.29, 0.8.0 and 1.0.0 archives remain unavailable; a clean 0.7.28 archive and the exact 0.7.28-to-0.7.29 Diffend comparison are retained.
Appendix · Affected releases
Indicators
- file_sha256jsextension.exe 7f986cd3c946f274cdec73f80b84855a77bc2a3c765d68897fbc42835629a5d5
References
Source record: oss/attacks/uaparser-js/meta.yaml