kaspacore-libnpm
Advisory published Updated
kaspacore-lib is a confirmed malicious npm package (MAL-2026-21126) that executes malicious code on install (malicious versions 1.0.1, 1.1.1). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in kaspacore-lib (npm)
What this malware does
kaspacore-lib 1.1.1 is a copy of @kaspa/core-lib 1.6.5 in which lib/crypto/random.js is replaced: for any request of 32 bytes or more it returns, instead of system randomness, an HMAC-SHA512 of a call counter and the process ID under a fixed key embedded in the file (in browsers, an XOR of that key, the counter and the current time). PrivateKey(), PrivateKey.fromRandom() and HDPrivateKey() draw 32 or 64 bytes from it, so private keys and HD seeds generated with this version can be recomputed by anyone who has the package by trying process IDs and small counter values. Version 1.0.1 is a stub library that, five seconds after import, sends the first 12 characters of the host name, hex-encoded, as a DNS lookup under v1.kaspacore-lib.io from a block labelled 'configuration resolver'.
Malicious versions
Detection & response playbook
Malicious packageFind it
Search your lockfiles and build artifacts for kaspacore-lib (2 malicious versions).
If you installed it — respond
Remove kaspacore-lib from your project and lockfile, then assume any secrets accessible to the build or runtime were exposed: rotate API keys, tokens, and credentials, and audit for unexpected outbound activity or persistence.
Did it already run?
If kaspacore-lib was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Credits
- Chainguard · finder
Detect & block this
O3 blocks kaspacore-lib-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.