Malicious npm Packages Targeting Red Hat Cloud Services Steal Credentials

Summary
Socket reports compromised @redhat-cloud-services npm packages that run an obfuscated payload during installation, harvest credentials and CI secrets, and exfiltrate data. The article details the malware’s behavior and recommends exposure review, containment, and secret
Key points
- Affected package versions run a malicious loader through an npm preinstall hook, so execution can occur during installation without importing the package.
- The loader decrypts and executes staged payloads, downloads Bun when needed, and may detach into a background process on non-CI systems.
- The malware is designed to collect GitHub Actions secrets, npm tokens, cloud and Kubernetes credentials, SSH keys, Git credentials, and other sensitive files.
- It can exfiltrate encrypted data over HTTPS or use the GitHub API to commit encrypted result files.
- Socket says attribution is unclear, noting that publicly available Shai-Hulud tooling lowers the barrier to similar operations.
- Organizations that installed affected versions should investigate developer machines and CI/CD systems, contain potentially affected hosts, remove malicious versions, and rotate accessible credentials.
Article Details
- Attack Vectors
- Compromised @redhat-cloud-services npm package versions execute an obfuscated JavaScript loader through a preinstall hook during npm installation.
- The loader decrypts embedded payloads at runtime, stages the main payload in a randomized temporary file, and executes it with Bun; the temporary file is then deleted.
- The payload collects environment variables, tokens, credentials, sensitive files, and GitHub Actions runner secrets, and can run as a detached background process on non-CI systems.
- Collected data is encrypted and sent by HTTPS POST to a decoded endpoint; a fallback can commit encrypted results to GitHub repositories using a stolen token.
- The package code can download Bun and includes logic to process repositories and modify GitHub repository or workflow files. Campaign attribution is unclear.
- Defensive Notes
- Treat systems that installed affected package versions as potentially compromised; isolate affected developer hosts, suspend affected CI runs, and rebuild from clean environments where feasible.
- Remove affected versions, verify replacement package metadata and provenance, and clear package caches that may contain affected tarballs.
- Rotate credentials accessible to affected processes, including GitHub and npm tokens, cloud credentials, Kubernetes and Vault tokens, SSH keys, Git credentials, and CI/CD secrets.
- Audit GitHub and npm activity for unexpected package releases, repository or workflow changes, Contents API writes, and files matching results-<timestamp>-<counter>.json.
- Inspect for randomized /tmp/p*.js payloads, /tmp/b-* Bun extraction directories, b.zip, unexpected Bun binaries, and tmp.0987654321.lock.
- Restrict GitHub Actions token permissions, reduce secrets exposed to dependency installation, enforce dependency controls, and monitor unexpected network egress and runtime downloads.
Indicators of compromise
| Type | Indicator | Context |
|---|---|---|
| SHA256 | 0dc06ecdaa63fe24859cfd955053c23245c536e4733480239d14bebf12688e35 | SHA-256 of the decrypted main payload. |
| SHA256 | 21b6409a7b84446310daca5409ad6112ac60a1e4bef97736e53fff5f63bfdef4 | SHA-256 of the malicious package/index.js loader. |
| SHA256 | 88896d478986d453f5da79b311de39d9b4b1bea95c21af1d8ef181b0f4e52fe9 | SHA-256 of the affected @redhat-cloud-services_chrome-2.3.1.tar.gz package artifact. |
| SHA256 | ac2a2208e1726e008be6c73dc0872d9bba163319259dff1b62055ac933ca46b6 | SHA-256 of the decrypted Bun helper. |
| SHA256 | ee262510cb246d2b904991aee7fc61162bdae34463439ec6383bd5356479d362 | SHA-256 of the affected package/package.json file. |
| URL | hxxps[:]//api[.]anthropic[.]com/v1/api | Decoded endpoint used by the payload for encrypted outbound data transfer; Socket does not assess the domain as threat actor-owned. |
MITRE ATT&CK
T1005 · Data from Local SystemThe payload collects host environment data and scans local files for credentials and other sensitive material.T1027 · Obfuscated Files or InformationThe loader uses obfuscated code, hidden strings, and encrypted embedded payloads to conceal functionality.T1033 · System Owner/User DiscoveryThe payload collects the local username and hostname.T1059.004 · Unix ShellThe loader invokes shell commands, including curl and unzip, to download and extract Bun.T1059.007 · JavaScriptThe package runs obfuscated JavaScript through Node.js and dynamically executes decrypted JavaScript payloads.T1070.004 · File DeletionThe loader deletes the temporary JavaScript payload file after execution.T1105 · Ingress Tool TransferThe package downloads the Bun runtime with curl when it is not already available.T1140 · Deobfuscate/Decode Files or InformationAt runtime, the loader decodes obfuscated source and decrypts embedded payloads before execution.T1195.002 · Compromise Software Supply ChainCompromised npm package releases in the @redhat-cloud-services namespace deliver the malicious loader.T1528 · Steal Application Access TokenThe payload collects GitHub CLI, GitHub, and npm authentication tokens.T1552.001 · Credentials In FilesThe payload searches credential files such as .npmrc, cloud configuration files, Git credentials, and SSH keys.T1552.005 · Cloud Instance Metadata APIThe article reports queries to AWS metadata endpoints as part of credential discovery.T1567.001 · Exfiltration to Code RepositoryWith a usable GitHub token, the payload can exfiltrate encrypted results by committing JSON files to GitHub repositories.T1614.001 · System Language DiscoveryThe payload checks system locale and environment variables for a Russian-language setting and changes behavior accordingly.
Threat Actors
Vendors
Products
Bun_b: a Bun installer/helper script.GitHub Actionsdeveloper imports or uses the package. Based on Socket’s analysis, the payload is designed to collect GitHub Actions secrets, npm tokens, cloud credentials, Kubernetes and Vault material, SSH keys, Git credentials, andnpmSocket has detected a malicious npm supply chain campaign involving compromised @redhat-cloud-services packages published under the Red Hat Cloud Services namespace. This is effectively a mini Shai-Hulud campaign: itRed Hat Cloud Servicessupply chain campaign involving compromised @redhat-cloud-services packages published under the Red Hat Cloud Services namespace. This is effectively a mini Shai-Hulud campaign: it uses the same core tactics of