Socket detected a malicious npm supply chain campaign in compromised @redhat-cloud-services packages that uses install-time execution, credential harvesting, encrypted exfiltration, and possible downstream propagation. The payload targets GitHub Actions secrets, npm tokens, cloud credentials, Kubernetes and Vault material, SSH keys, and Git credentials while using Shai-Hulud-like tactics and GitHub/Anthropic infrastructure for staging and exfiltration. #RedHatCloudServices #ShaiHulud #TeamPCP #BreachForums #Anthropic #Bun
Keypoints
- Compromised @redhat-cloud-services npm packages were published under the Red Hat Cloud Services namespace and contained malicious code.
- The campaign mirrors Shai-Hulud-style techniques, including install-time execution, credential theft, CI/CD targeting, and encrypted exfiltration.
- A preinstall hook runs node index.js automatically during npm install, allowing the payload to execute before the package is used.
- The malware decrypts hidden payloads with AES-GCM, stages them in /tmp, and executes them through Bun, downloading Bun if needed.
- It collects GitHub Actions secrets, npm tokens, cloud credentials, Kubernetes and Vault data, SSH keys, Git credentials, and other sensitive files.
- Exfiltration occurs through encrypted HTTPS POST requests, with a GitHub commit-based fallback that can write results–.json files.
- Attribution remains unclear because the public release of Shai-Hulud tooling lowers the barrier for multiple threat actors to run similar campaigns.
MITRE Techniques
- [T1059.007] JavaScript – The malicious package executes JavaScript during installation and runtime through node index.js and eval-based decryption (‘The package.json contains: “preinstall”:”node index.js” … This causes the malicious loader to execute automatically before installation completes.’).
- [T1204.002] User Execution: Malicious File – The payload runs when npm install triggers lifecycle scripts, requiring no direct user launch of the package (‘Executes index.js automatically during npm install.’).
- [T1027] Obfuscated Files or Information – The loader hides behavior using char-code arrays, ROT-style transforms, and encrypted blobs (‘Stage-one JavaScript obfuscation … AES-128-GCM encrypted blobs … Custom payload string encryption.’).
- [T1140] Deobfuscate/Decode Files or Information – The malware decodes and decrypts embedded content at runtime to reveal the helper and main payload (‘This decodes into an async wrapper … decrypts embedded payloads.’).
- [T1021.004] Remote Services: SSH – It targets SSH keys and related files for credential theft, enabling remote access (‘~/.ssh/id*’, ‘~/.ssh/id_rsa’, ‘~/.ssh/id_ed25519’).
- [T1552.001] Unsecured Credentials: Credentials In Files – It searches for sensitive files such as .npmrc, .netrc, cloud configs, and Git credentials (‘~/.aws/credentials’, ‘~/.npmrc’, ‘~/.git-credentials’).
- [T1552.004] Unsecured Credentials: Private Keys – It specifically seeks SSH private keys and similar secret material (‘~/.ssh/id_rsa’, ‘~/.ssh/id_ed25519’).
- [T1539] Steal Web Session Cookie – The payload collects GitHub and npm authentication tokens that can function as session-like access tokens (‘Collects GitHub Actions secrets, npm tokens … GitHub CLI token via gh auth token’).
- [T1611] Escape to Host – It attempts privileged execution on CI runners with sudo, expanding access on build hosts (‘Attempts privileged execution on CI runners.’).
- [T1053.003] Scheduled Task/Job: Cron – The malware does not use cron directly, so no confirmed technique is listed here.
- [T1053.005] Scheduled Task/Job: At – The daemonized background execution behaves like persistence but no explicit scheduled task is shown (‘Detaches into a background process on developer workstations.’).
- [T1132.001] Data Encoding: Standard Encoding – It base64-encodes encrypted envelopes and payload content before transmission (‘toString(“base64”)’).
- [T1041] Exfiltration Over C2 Channel – Stolen data is sent over HTTPS POST to an external endpoint (‘Sends encrypted collection results over HTTPS POST.’).
- [T1105] Ingress Tool Transfer – It downloads Bun from GitHub using curl and unzip to enable execution (‘Silently downloads an execution runtime during package install.’).
- [T1071.001] Application Layer Protocol: Web Protocols – Network communication occurs over HTTPS to API endpoints for exfiltration and fallback activity (‘https://api.anthropic.com:443/v1/api’, ‘https://api.github.com’).
- [T1505.003] Server Software Component: Web Shell – Not evidenced in the article, so no confirmed use is listed.
- [T1562.001] Impair Defenses: Disable or Modify Tools – It uses anti-analysis checks such as Russian locale avoidance and environment checks to reduce detection (‘Avoids execution or changes behavior on Russian-language systems.’).
Indicators of Compromise
- [Package names] compromised npm packages – @redhat-cloud-services/chrome, @redhat-cloud-services packages
- [Package version] affected release – 2.3.1, and other affected versions mentioned on the campaign page
- [Network domain] encrypted exfiltration destination – api.anthropic[.]com, https://api.anthropic[.]com:443/v1/api
- [Network domain] GitHub API fallback and staging – api.github[.]com, https://api.github[.]com/graphql
- [Network URL] Bun runtime download source – https://github[.]com/oven-sh/bun/releases/download/bun-v1.3.13/
- [File name] temporary payload and lock artifacts – /tmp/p*.js, tmp.0987654321.lock
- [File name] GitHub fallback exfiltration files – results–.json, results/results–.json
- [File name] downloaded runtime archive and extracted binary – b.zip, bun.exe, bun
- [String / token] unique commit marker and message – IfYouInvalidateThisTokenItWillNukeTheComputerOfTheOwner, Miasma: The Spreading Blight
- [SHA-256 hash] package artifacts and payloads – 88896d478986d453f5da79b311de39d9b4b1bea95c21af1d8ef181b0f4e52fe9, 21b6409a7b84446310daca5409ad6112ac60a1e4bef97736e53fff5f63bfdef4, and 2 more hashes
Read more: https://socket.dev/blog/mini-shai-hulud-campaign-hits-red-hat-cloud-services-npm-packages