npm/keyv version 6.0.0 is a trojanized release published on 2026-08-04 during the compromise of the npm/GitHub maintainer account behind the keyv and cacheable package families (user "Jaredwray"). Attackers pushed the malicious payload to the source repository and cut releases through GitHub Actions, so the poisoned versions reached npm with a valid, signed provenance attestation (provenance attests build integrity, not source integrity). Delivery is through the npm install lifecycle: the trojanized package.json adds a preinstall hook ("preinstall": "node setup.mjs") that runs before any project code on a bare npm install, while the normal compiled output is left intact so the package still works after install. setup.mjs downloads a standalone Bun runtime and uses it to run a second stage (shipped as MathSymbol.js, a heavily obfuscated ~728 KB Bun bundle, referenced at runtime as mathinit.js). The stealer harvests credentials from cloud instance metadata (AWS IMDS at 169.254.169.254, ECS at 169.254.170.2, GCP, Azure), AWS/GCP/Azure keys, HashiCorp Vault tokens, Kubernetes service-account tokens, GitHub Actions OIDC and org/repo secrets, and npm tokens, with a TruffleHog-style regex sweep for further secrets and private keys. Using the stolen npm identity (including npm OIDC trusted publishing) it enumerates and republishes further packages the token can reach — which, for a maintainer controlling both keyv and cacheable, gave the worm a large blast radius. Stolen findings are exfiltrated to attacker-created GitHub repositories (descriptions reading "Shai-Hulud: Here We Go Again") and to destinations resolved over DNS, and autostart hooks are planted in the repository's .claude/ and .vscode/ configuration to run the loader when a developer or AI coding agent opens a clone. Treat any environment that installed this version (with install scripts enabled) as fully compromised and rotate every reachable credential. Part of the August 2026 npm worm that poisoned 400+ packages across many organizations.
-= Per source details. Do not edit below this line.=-
keyv@6.0.0 is a lookalike of the popular keyv key-value package but ships an attack chain absent from the real library. The package.json preinstall hook runs a heavily obfuscated setup.mjs whose strings (URLs, shell commands, platform tokens, payload filename) are all reconstructed at runtime via a rotated string-array plus RC4-style decoder. On install, setup.mjs reassembles a GitHub-releases URL for a platform-specific Bun runtime archive (bun-linux-, bun-darwin-, bun-windows-*), downloads it, extracts it via PowerShell Expand-Archive or unzip, chmod+x's the resulting binary, and then uses execFileSync to invoke the shipped MathSymbol.js under that dropped Bun runtime. MathSymbol.js is a ~727 KB Bun-compiled bundle (// @bun @bun-cjs prelude) with obfuscated identifiers and a large constant table; it is not referenced by dist/index.mjs and only ever runs under the alien Bun runtime dropped at install. The library's advertised key-value storage has no need for a second language runtime or a hidden compiled bundle. Installing this package causes attacker-controlled code to execute on the installer's machine automatically via the npm preinstall lifecycle, using an alien-runtime dispatch that evades scanners inspecting only Node-resolved code.
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
{
"malicious-packages-origins": [
{
"versions": [
"6.0.0"
],
"modified_time": "2026-08-04T21:07:18Z",
"id": "IN-MAL-2026-010972",
"import_time": "2026-08-04T21:33:11.726128238Z",
"sha256": "4b828a8383aadd40e3c94c5be32dc4466e0d7c4872550f6316da2a195e978ca5",
"source": "amazon-inspector"
},
{
"versions": [
"6.0.0"
],
"modified_time": "2026-08-04T11:19:15Z",
"id": "GHSA-3p9h-f68w-m6fx",
"import_time": "2026-08-05T00:10:17.860265883Z",
"sha256": "48375bb2643bebbc43e5fd4ee45e9810e9fe77bf95e434aeafbc22d63ab577e6",
"source": "ghsa-malware"
}
],
"iocs": {
"files": [
{
"paths": [
"setup.mjs"
],
"note": "Stage 1 loader added to the package tarball and run via the preinstall script 'node setup.mjs'. Downloads a standalone Bun runtime and executes the second stage under it.",
"source": "PACKAGE_ARCHIVE"
},
{
"paths": [
"Math_Symbol.js",
"math_init.js"
],
"note": "Stage 2 payload: byte-identical, heavily obfuscated ~728 KB Bun-bundle credential stealer, shipped in the tarball as Math_Symbol.js and executed at runtime as math_init.js.",
"source": "PACKAGE_ARCHIVE"
}
]
}
}{
"package_integrity": [
{
"hashes": {
"sha512_sri": "sha512-N/n4R+nD5SC0fYOpAp4ZnbwwxqGVodgEZ9D7Gm/VBocorU0aQimVyleDWSY6/axdO0/temub760n3hnMppZpUg==",
"sha1": "0f18da4e81443285c3ee7e96eb3adc3803b2487e"
},
"filename": "keyv-6.0.0.tgz"
}
],
"evidence_files": [
{
"tlsh": "22d2e98e35aa70e2526331b37c7791a5f97facc077c84414f998ac5afd6c22cc18669c",
"path": "setup.mjs",
"sha256": "54dc7ea54a1317cca0e890a2770630cf7fa6c97813e0cb9d2caa93012b350668"
},
{
"tlsh": "59f493746ec2786982736b5f2199e372e2652e11c27e73fb57e0e432a54c22c30eb51d",
"path": "Math_Symbol.js",
"sha256": "9fc2570b7cef51c1b8df116d144d11ff4096357be7d2c4c6367cfc2509cf1bcc"
}
]
}
[
{
"name": "Embedded Malicious Code",
"description": "The product contains code that appears to be malicious in nature.",
"cweId": "CWE-506"
},
{
"name": "Embedded Malicious Code",
"description": "The product contains code that appears to be malicious in nature.",
"cweId": "CWE-506"
}
]
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/keyv/MAL-2026-11524.json"