cvelo
P2 · HighMalware

Malicious code in kaspacore-lib (npm)

  • MAL-2026-21126

Description

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'.

Text from the OSV record.

Recommendation

Remove the package and rotate any secret the machine that installed it could reach. There is no version to update to.

Affected

  • kaspacore-libnpm

    No versions listed

Timeline

  1. Published

Related news

No article from the followed outlets names this vulnerability.