LWA-2026-13729 confirmed malware

kaspacore-lib@1.1.1

Malicious code in kaspacore-lib (npm)

T1195.002 · Compromise Software Supply ChainT1600 · Weaken EncryptionT1552 · Unsecured Credentials

Analysis

kaspacore-lib is a JavaScript library for generating Kaspa addresses, private keys and HD wallets. This version ships a modified key-generation RNG that makes the keys it produces predictable. In package/lib/crypto/random.js, the random-buffer helper does not call crypto.randomBytes for the sizes that matter. For any request of 32 bytes or more it returns HMAC-SHA512 output keyed with a hardcoded hex constant embedded in the file, over the string "<counter>:<process.pid>", sliced to the requested length; only requests smaller than 32 bytes fall through to crypto.randomBytes. The browser branch likewise derives bytes by XOR-ing the same hardcoded constant against a Date.now()-seeded value instead of calling window.crypto.getRandomValues. That buffer is the sole entropy source for the library's wallet key paths: lib/privatekey.js (PrivateKey._getRandomBN, used by new PrivateKey(), PrivateKey.fromRandom) takes 32 bytes from it, lib/hdprivatekey.js (_generateRandomly) takes 64 bytes from it for HD seeds, and lib/crypto/ecdsa.js (randomK) uses it for the signing nonce. Because the HMAC key is a constant published inside the package and the remaining inputs are only a process counter and the process id, the resulting private keys and HD seeds live in a very small, enumerable keyspace, so keys and funds behind addresses generated with this library can be recovered by an attacker. The package contains no lifecycle scripts, no network client code and no obfuscation; the malicious behaviour is limited to the weakened key-generation RNG, so there is no C2 host, IP or URL to report.

analyzed by
Leitwacht
first seen
Nov 6, 2026, 03:35 PM
analyzed
Nov 6, 2026, 03:36 PM

Related advisories

browse all confirmed advisories →

Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.