MAL-2026-21126

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/kaspacore-lib/MAL-2026-21126.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-21126
Published
2026-12-02T08:00:00Z
Modified
2026-12-04T04:15:03Z
Summary
Malicious code in kaspacore-lib (npm)
Details

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

Database specific
{
    "iocs":  {
        "domains":  [
            "v1.kaspacore-lib.io"
        ],
        "files":  [
            {
                "digests":  {
                    "sha256":  "837b901bf2c9c0c455ddaad90f85fcb4423790acb8740870878e0c63fc8f3204"
                },
                "note":  "1.1.1: Random source replaced by an HMAC-SHA512 under a fixed key for requests of 32 bytes or more (lines 4-5, 17-22, 30-38). The other code files are byte-identical to @kaspa/core-lib 1.6.5.",
                "paths":  [
                    "lib/crypto/random.js"
                ],
                "source":  "PACKAGE_ARCHIVE"
            },
            {
                "digests":  {
                    "sha256":  "5e75dc39a2ca33827a18bd0c559d5281b42ba56c1907a5ee5a611836ae6d025f"
                },
                "note":  "1.0.1: Resolves the hex-encoded first 12 characters of the host name as a label under v1.kaspacore-lib.io five seconds after import (lines 52-56).",
                "paths":  [
                    "lib/index.js"
                ],
                "source":  "PACKAGE_ARCHIVE"
            }
        ]
    }
}
Credits

Affected packages

npm / kaspacore-lib

Package

Name
kaspacore-lib
View open source insights on deps.dev
Purl
pkg:npm/kaspacore-lib

Affected ranges

Affected versions

1.*
1.0.1
1.1.1

Database specific

cwes
[
    {
        "cweId":  "CWE-506",
        "description":  "The product contains code that appears to be malicious in nature.",
        "name":  "Embedded Malicious Code"
    }
]
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/kaspacore-lib/MAL-2026-21126.json"