Skip to content
.ca
7 mincritical

Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages

A supply chain attack dubbed 'Mini Shai-Hulud' compromised numerous npm packages, notably within the @redhat-cloud-services namespace. The malicious packages use preinstall hooks to execute an obfuscated loader that decrypts and runs a credential-harvesting payload via the Bun runtime, targeting CI/CD secrets, cloud credentials, and developer tokens for encrypted exfiltration.

Sens:■ ImmediateConf:highAnalyzed:2026-06-04models

Authors: Socket Research Team

Actorsmini Shai-HuludTeamPCP

Source:Socket

Indicators of Compromise8
5sha2561filename1npm package1url
Improve this report

Send corrections, useful missing information, or quality feedback. It is private and will not appear as a comment.

Feedback type

Detection / Huntermodels

What Happened

Attackers published malicious software packages that look like legitimate Red Hat Cloud Services tools. When a developer or automated system installs these packages, hidden code automatically runs and steals sensitive passwords, cloud access keys, and source code tokens. This matters because stolen credentials can allow attackers to access company networks, cloud environments, and code repositories. Organizations should check if they downloaded these specific packages, remove them, and immediately change any passwords or keys that might have been exposed.

Key Takeaways

  • Malicious npm packages published under the @redhat-cloud-services namespace execute obfuscated payloads during the preinstall phase.
  • The malware decrypts and executes a secondary payload using Bun, downloading the Bun runtime silently if not already present.
  • The primary goal is harvesting sensitive credentials, including GitHub Actions secrets, cloud provider tokens, and SSH keys.
  • Exfiltration occurs via encrypted HTTPS POST to an abused Anthropic API endpoint, with a fallback mechanism of committing encrypted JSON files to GitHub repositories.
  • The malware daemonizes on non-CI systems to maintain persistence and continue scanning developer workstations.

Affected Systems

  • Node.js environments
  • CI/CD pipelines (especially GitHub Actions)
  • Developer workstations installing the affected npm packages

Attack Chain

The attack begins when a victim installs a compromised npm package, triggering a preinstall script that runs an obfuscated JavaScript loader. This loader decrypts an embedded payload using AES-128-GCM, writes it to a temporary file, and executes it using the Bun runtime, which it downloads silently if necessary. Once running, the malware harvests sensitive environment variables, cloud credentials, and SSH keys, and daemonizes on non-CI systems for persistence. Finally, the stolen data is compressed, encrypted, and exfiltrated via HTTPS POST to an abused API endpoint, with a fallback mechanism of committing encrypted JSON files to GitHub repositories.

Detection Engineering Assessment

Required Log Sources

  • Process Creation (Event ID 4688 / Sysmon 1)
  • File Creation (Sysmon 11)
  • Network Connections (Sysmon 3)

Hunting Hypotheses

copy:
HypothesisTelemetryATT&CK StageFP Risk
Consider hunting for node.js processes spawning curl or wget to download files from GitHub releases, particularly the Bun runtime, which is atypical during standard package installations.Process CreationExecutionLow
If you have visibility into process execution, look for bun run executing scripts from the /tmp directory (e.g., /tmp/p*.js).Process CreationExecutionLow
Consider hunting for the execution of 'gh auth token' by non-interactive or background processes, indicating potential credential harvesting.Process CreationCredential AccessLow
Evaluate whether node.js or bun processes are making unexpected outbound network connections to api.anthropic.com during CI/CD pipeline runs.Network ConnectionsExfiltrationMedium

Control Gaps

  • Static code analysis (bypassed by AES-GCM runtime decryption)
  • Standard dependency vulnerability scanners (malware is newly published, not a known CVE)

Key Behavioral Indicators

  • node spawning curl or unzip
  • node spawning bun
  • Creation of tmp.0987654321.lock
  • Process environment variable __IS_DAEMON set to 1

False Positive Assessment

  • Low

Recommendations

Immediate Mitigation

  • Verify against your organization's incident response runbook and team escalation paths before acting.
  • Search source repositories, lockfiles, and CI logs for the affected package names (e.g., @redhat-cloud-services/*, @jagreehal/workflow).
  • If an affected package was installed, isolate the host and preserve logs before attempting remediation.
  • Rotate all potentially exposed credentials, including GitHub tokens, cloud provider keys, and SSH keys.

Infrastructure Hardening

  • Consider implementing network egress controls for CI/CD runners to block unexpected outbound traffic during dependency installation.
  • Evaluate restricting default GitHub Actions token permissions to least privilege.
  • Where practical, run dependency installation with lifecycle scripts disabled by default (--ignore-scripts), then allowlist required scripts.

User Protection

  • Consider implementing EDR rules to detect anomalous child processes spawned by package managers (e.g., npm or node spawning curl).

Security Awareness

  • Educate developers on the risks of typosquatting and namespace confusion in package registries.

MITRE ATT&CK Mapping

  • T1059.007 - Command and Scripting Interpreter: JavaScript
  • T1027.002 - Obfuscated Files or Information: Software Packing
  • T1078 - Valid Accounts
  • T1552.001 - Unsecured Credentials: Credentials In Files
  • T1552.004 - Unsecured Credentials: Private Keys
  • T1562.001 - Impair Defenses: Disable or Modify Tools
  • T1105 - Ingress Tool Transfer
  • T1048.002 - Exfiltration Over Alternative Protocol: Exfiltration Over Asymmetric Encrypted Non-C2 Protocol
IOCs · 8
.txt.json
Showing defanged values