A threat actor compromised hundreds of npm packages on August 4, 2026 and used them to distribute a self-propagating backdoor that spreads in ways similar to the Shai-Hulud npm worm. The campaign affected popular packages such as Keyv, Cacheable, and Ecto, and used multiple propagation, exfiltration, and credential-theft paths across npm, GitHub, cloud, and CI environments. #Keyv #Cacheable #Ecto #ShaiHulud
Keypoints
- The incident began with a malicious commit in the popular keyv npm package repository, followed by similar commits to related projects.
- The compromised packages were published with a loader and second-stage payload that can execute during installation through a preinstall script.
- The payload can run under Bun, collect files, environment variables, cloud credentials, GitHub tokens, and CI secrets, and then exfiltrate the data.
- Propagation can occur through stolen npm tokens, GitHub credentials, or injected workflows and repository modifications.
- The campaign published malicious versions of multiple Cacheable-family packages, as well as [email protected] and [email protected].
- The exfiltration logic includes a contract-selected HTTPS endpoint, GitHub-based fallback discovery, and a public GitHub repository fallback for data theft.
- The article provides SHA-256 hashes and other indicators for the loader, stage-two payload, injected workflow, and token-monitoring components.
MITRE Techniques
- [T1195.001] Compromise Software Supply Chain â The actor modified npm packages and published malicious versions to spread the payload (âcompromised hundreds of npm packages and used them to propagate a backdoorâ).
- [T1059.004] Command and Scripting Interpreter: Unix Shell â The payload uses shell commands and scripts during execution and collection (ânode setup.mjs through preinstallâ, âpipelinesâ, âunzipâ, âsudo python3â).
- [T1059.006] Command and Scripting Interpreter: JavaScript â The loader and second stage execute JavaScript code under Bun and Node.js (âThe loader synchronously starts Bunâ, âif (responseBody.code) { await eval(responseBody.code); }â).
- [T1105] Ingress Tool Transfer â The loader downloads Bun from an official release URL when it is not installed (âconstructs an official Bun release URLâ, âThe downloader uses a node User-Agentâ).
- [T1027] Obfuscated Files or Information â The second stage is heavily obfuscated with Base91 tables, split strings, and flattened state machines (âIts obfuscation combines a 4,613-entry Base91 string tableâ).
- [T1053.005] Scheduled Task/Job: Scheduled Task â The malware installs persistence-like hooks through package scripts and startup hooks in project files (âpreinstallâ, â.vscode/tasks.jsonâ, â.claude/settings.jsonâ).
- [T1056] Input Capture â The payload searches for and extracts tokens, secrets, and credentials from files and process memory (âfiles, environment variables, runner memory, and cloud secret stores are queriedâ).
- [T1005] Data from Local System â It reads selected files, environment variables, Kubernetes secrets, and more from the host (âFull contents of selected filesâ, âentire process.envâ).
- [T1071.001] Application Layer Protocol: Web Protocols â Exfiltration and command retrieval occur over HTTPS (âmakes an HTTPS GET to port 443 on /routerâ).
- [T1106] Native API â The code uses system-native behavior and process mechanisms such as detached execution, unref, and memory access (ârespawns its current executable with the same argumentsâ, âreads each readable mapping through /proc//memâ).
- [T1552.001] Unsecured Credentials: Credentials In Files â It hunts for tokens and secret material in files and histories (âenvironment files, shell histories, SSH material, Git, npm, PyPI, cloud, Kubernetesâ).
- [T1098] Account Manipulation â The actor uses valid credentials to create branches, releases, workflows, and package publications (âuses valid npm or GitHub credentials conditionallyâ).
- [T1190] Exploit Public-Facing Application â The injected GitHub workflow and repository abuse paths leverage exposed services and valid tokens to trigger execution (âcreates a workflowâ, âdownloads and reads the artifactâ).
- [T1528] Steal Application Access Token â The malware explicitly looks for npm, GitHub, and cloud tokens and then reuses them for propagation and exfiltration (âlooks for classic GitHub personal access or OAuth tokensâ, âFor each collected token matching npmâs granular-token formatâ).
- [T1621] Multi-Factor Authentication Request Generation â The npm propagation path requires bypass_2fa access when checking stolen tokens (ârequires a matching record with bypass_2fa: trueâ).
- [T1213] Data from Information Repositories â It queries GitHub, AWS, Kubernetes, Vault, and Actions stores for secrets (âGitHub REST endpoints for repository and organization Actions secretsâ).
Indicators of Compromise
- [Git commit hashes ] Malicious and related commits in affected repositories â 174f6a5, 893f73f⌠and other recovered malicious commits
- [Package names and versions ] Confirmed malicious npm packages and versions â [email protected], [email protected], and @cacheable/[email protected]
- [Domains / URLs ] Exfiltration and loader infrastructure â https://github.com/oven-sh/bun/releases/download/bun-v1.3.13/.zip, https://:443/router
- [Ethereum contract / selector ] Smart-contract dead drop used for C2 â 0xE1f2395ee43e45A1556EC6438a88c31B83493103, 0x53ed5143
- [File names ] Loader, payload, and injected workflow files â setup.mjs, Math_Symbol.js, codeql_analysis.yml
- [Hashes ] SHA-256 values for recovered artifacts â 9fc2570b7cef51c1b8df116d144d11ff4096357be7d2c4c6367cfc2509cf1bcc, fd3ca4007b225fdf8de7af4345a19179d5efa8c4bb9205f88cda806e5684b1eb, and other listed hashes
- [Lock file / runtime markers ] Persistence and recursion controls â tmp.dpkg_14527.lock, _NODE_RUNTIME_INIT=1
- [Token relay / exfiltration markers ] GitHub token abuse markers and fallback repo description â IfYouBlockThisAPIKeyItWillCrashTheLiveProductionServersOfAllThirdPartyClients, Shai-Hulud: Here We Go Again
Read more: https://securitylabs.datadoghq.com/articles/npm-worm-compromises-popular-npm-packages/