kaspacore-lib (npm): malicious versions generate predictable private keys and exfiltrate hostnames via DNS (no CVE)
Severity: critical · Patch status: no-fix-needed · Since 2026-12-04
GitHub's malware advisory database (via OpenSSF) flags two malicious versions of the npm package kaspacore-lib. Version 1.1.1 is a copy of @kaspa/core-lib 1.6.5 with lib/crypto/random.js replaced: requests of 32+ bytes return an HMAC-SHA512 of a call counter and process ID under a fixed embedded key (or an XOR of key, counter and time in browsers), making private keys and HD seeds from PrivateKey(), PrivateKey.fromRandom() and HDPrivateKey() reproducible by anyone with the package. Version 1.0.1 is a stub that, five seconds after import, sends the first 12 hex-encoded hostname characters via DNS to v1.kaspacore-lib.io. No patched versions exist; users must remove the package and regenerate all keys and wallets created with it.
What to do
- Immediately remove kaspacore-lib from all projects and lockfiles
- Treat every private key, HD seed or wallet generated with version 1.1.1 as compromised; regenerate keys with a trusted library and move funds
- Audit environments that imported 1.0.1 for DNS beaconing to v1.kaspacore-lib.io and treat exposed hostnames as leaked
- Replace with the official @kaspa/core-lib from a verified source and pin integrity hashes
- Review dependency trees and CI caches for reintroduction of the package
Sources
All live incidents on Threat Watch