MAL-2026-11558

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/@cacheable/memory/MAL-2026-11558.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-11558
Aliases
  • GHSA-583f-9h76-9fx2
Published
2026-08-04T11:35:29Z
Modified
2026-08-05T07:19:54.742534026Z
Summary
Malicious code in @cacheable/memory (npm)
Details

npm/@cacheable/memory version 2.2.1 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.=-

Source: amazon-inspector (ebe7a0a2aff9bf2b220ec45815bac808fad1beff90c727413d80660fe517f405)

package.json declares preinstall: node setup.mjs. setup.mjs is a heavily obfuscated script (string-array table with RC4-based decoder, per-call scrambled hex indices) that reconstructs all URLs, command names, and file paths at runtime. On install it downloads a Bun runtime archive from github.com/oven-sh/bun releases (platform-selected), extracts it (custom EOCD/inflate reader on Unix, PowerShell Expand-Archive on Windows), chmods the bun binary, and executes it against the sibling Math_Symbol.js — a 727KB Bun-compiled (// @bun @bun-cjs) obfuscated second-stage payload that is opaque to Node-based scanners because it only runs under the fetched alternate runtime. The package advertises itself as High Performance In-Memory Cache for Node.js and copies the jaredwray/cacheable author and repository metadata, and it ships a normal-looking dist/index.cjs, but the obfuscated preinstall + Bun payload has no relationship to that advertised purpose. The alternate-runtime-dropper chain (obfuscated preinstall → fetch second runtime → execute opaque bundled payload) grants arbitrary code execution on any installer's host at npm install time.

Source: ghsa-malware (451021493ba0e9af7a9293eba6f30355c8274cf2e596c30d00923731a4fe2a99)

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.

Database specific
{
    "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"
            }
        ]
    },
    "malicious-packages-origins": [
        {
            "versions": [
                "2.2.1"
            ],
            "id": "GHSA-583f-9h76-9fx2",
            "import_time": "2026-08-05T00:10:17.906705095Z",
            "modified_time": "2026-08-04T11:35:29Z",
            "source": "ghsa-malware",
            "sha256": "451021493ba0e9af7a9293eba6f30355c8274cf2e596c30d00923731a4fe2a99"
        },
        {
            "versions": [
                "2.2.1"
            ],
            "id": "IN-MAL-2026-013487",
            "import_time": "2026-08-05T07:06:49.924694431Z",
            "modified_time": "2026-08-05T06:30:12Z",
            "source": "amazon-inspector",
            "sha256": "ebe7a0a2aff9bf2b220ec45815bac808fad1beff90c727413d80660fe517f405"
        }
    ]
}
References
Credits

Affected packages

npm / @cacheable/memory

Package

Name
@cacheable/memory
View open source insights on deps.dev
Purl
pkg:npm/%40cacheable/memory

Affected ranges

Affected versions

2.*
2.2.1

Database specific

cwes
[
    {
        "cweId": "CWE-506",
        "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."
    }
]
indicators
{
    "package_integrity": [
        {
            "filename": "memory-2.2.1.tgz",
            "hashes": {
                "sha512_sri": "sha512-U5Cf50VpVN3uEOgZsaLjORrlzLSuu3wH5VwzhwagU0TNmWFJ829AmVXd7gCxcOQxkoaOdS4NEUyVOpfR0H4aDw==",
                "sha1": "7b93c9509f8782e52a19e2d7108240708e6af15c"
            }
        }
    ],
    "evidence_files": [
        {
            "path": "package.json",
            "tlsh": "e131cf28d4a9ee7325c861b9bc994506aa6008474a487d1837cf812c4f9d2df06ff7fd",
            "sha256": "cbcde21df1f0ec0752fa4926f7745e08b05492526b76e148760e3dab7d12f4c4"
        },
        {
            "path": "setup.mjs",
            "tlsh": "22d2e98e35aa70e2526331b37c7791a5f97facc077c84414f998ac5afd6c22cc18669c",
            "sha256": "54dc7ea54a1317cca0e890a2770630cf7fa6c97813e0cb9d2caa93012b350668"
        },
        {
            "path": "Math_Symbol.js",
            "tlsh": "59f493746ec2786982736b5f2199e372e2652e11c27e73fb57e0e432a54c22c30eb51d",
            "sha256": "9fc2570b7cef51c1b8df116d144d11ff4096357be7d2c4c6367cfc2509cf1bcc"
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/@cacheable/memory/MAL-2026-11558.json"