Malicious code in kaspacore-lib (npm)
- GHSA-5g8p-g2fc-x9pr
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'. --- Credit: [OpenSSF](https://github.com/ossf/malicious-packages) ([source](https://github.com/ossf/malicious-packages/blob/187f0aa592d17132b1d2bfc8fa1582dd170c133e/osv/malicious/npm/kaspacore-lib/MAL-2026-21126.json))
Text from the GitHub Advisory 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
- Published
Related news
No article from the followed outlets names this vulnerability.