32 Red Hat npm packages backdoored in 72 seconds

32 Red Hat npm packages backdoored in 72 seconds
ReversingLabs identified a coordinated supply chain attack against the @redhat-cloud-services npm scope in which 32 malicious package versions were published in 72 seconds, affecting about 9.8 million downloads. The payload used layered obfuscation, installed a bun-based credential stealer during npm install, and may have enabled further package propagation through stolen npm credentials. #RedHatCloudServices #bun #GitHubActions #AWS #Azure #GoogleCloud #HashiCorpVault #npm #obfuscatorio

Keypoints

  • 32 packages in the @redhat-cloud-services npm scope were compromised in a 72-second publishing burst on June 1, 2026.
  • The malicious versions collectively account for approximately 9.8 million total downloads across Red Hat’s Hybrid Cloud Console JavaScript ecosystem.
  • Each affected package was modified in the same way: package.json gained a preinstall script and index.js was replaced with a malicious loader.
  • The attack used a multi-layer design involving ROT-N encoding, AES-128-GCM decryption, and an obfuscated payload generated with obfuscator.io.
  • The main payload is a credential stealer targeting AWS, Azure/ARM, Google Cloud, HashiCorp Vault, GitHub, npm, and SSH data.
  • The payload can detect GitHub Actions environments and exfiltrate stolen data through the GitHub API, suggesting CI/CD-focused targeting.
  • The malware includes worm-like propagation logic that could publish new malicious package versions using stolen npm credentials.

MITRE Techniques

  • [T1059.007] Command and Scripting Interpreter: JavaScript – The attack runs malicious JavaScript through package installation and later executes the decrypted payload with Bun (‘the package’s main entry point is completely replaced with a malicious payload’, ‘it is used directly’).
  • [T1204.002] User Execution: Malicious File – The preinstall script causes execution during npm install, so the malicious code runs when developers install dependencies (‘preinstall script entry is added’, ‘during any npm install run’).
  • [T1027] Obfuscated Files or Information – The payload is hidden with ROT-N, AES-128-GCM, and obfuscator.io layers (‘obfuscated preinstall malware’, ‘heavily obfuscated using the obfuscator.io toolchain’).
  • [T1027.013] Obfuscated Files or Information: Encrypted/Encoded File – The malware stores encrypted blobs and decodes them at runtime using AES-128-GCM and ROT-N (‘decrypts two encrypted blobs’, ‘rotation value N differs per package’).
  • [T1140] Deobfuscate/Decode Files or Information – The code reconstructs and decodes the payload from character codes and encrypted blobs before execution (‘String.fromCharCode reconstructs a string’, ‘decryption of the chrome package payload’).
  • [T1056.001] Input Capture: Keylogging – Not a traditional keylogger, but it harvests credential material from environment variables, token files, and SSH data (‘AWS_ACCESS_KEY_ID’, ‘GITHUB_TOKEN’, ‘~/.ssh/’).
  • [T1552.001] Unsecured Credentials: Credentials In Files – It reads credentials from files such as ~/.npmrc, SSH files, and cloud credential files (‘~/.npmrc’, ‘~/.ssh/’, ‘application default credential files’).
  • [T1552.004] Unsecured Credentials: Private Keys – The malware targets SSH material and other secret-bearing files that can contain private key data (‘~/.ssh/’).
  • [T1528] Steal Application Access Token – It targets GitHub tokens and workflow-related secrets from development environments (‘GITHUB_TOKEN’, ‘GITHUB_WORKFLOW_REF’).
  • [T1105] Ingress Tool Transfer – The malware downloads the Bun runtime from GitHub before executing the main payload (‘downloads the bun runtime (v1.3.13) from github.com/oven-sh/bun/releases’).
  • [T1071.001] Application Layer Protocol: Web Protocols – Stolen data is exfiltrated via the GitHub API and HTTP connections (‘exfiltrated via the GitHub API’, ‘Connects through HTTP’).
  • [T1057] Process Discovery – It checks for GitHub Actions context by inspecting environment variables to determine where it is running (‘checks GITHUB_REPOSITORY and GITHUB_WORKFLOW_REF’).
  • [T1547.001] Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder – The preinstall script creates automatic execution during installation, acting as an execution persistence mechanism within the build process (‘preinstall script’).
  • [T1218.011] System Binary Proxy Execution: Rundll32 – Not applicable; no evidence in the article.
  • [T1203] Exploitation for Client Execution – Not mentioned; the attack relies on package installation rather than exploitation.
  • [T1106] Native API – The payload uses Node.js crypto APIs to decrypt and run encrypted content (‘createDecipheriv(“aes-128-gcm”)’).
  • [T1036] Masquerading – The attack blends into legitimate package and runtime behavior by using a real Bun release from an official GitHub repository (‘legitimate binary from a legitimate source’).

Indicators of Compromise

  • [SHA-256 ] malicious index.js files – 21b6409a7b84446310daca5409ad6112ac60a1e4bef97736e53fff5f63bfdef4, 5c6cb758a3447bc7e0de34406919a933f9351e90ef04ec43f3bbb401e7004e1b, and 2 more hashes
  • [Package versions ] compromised npm versions – @redhat-cloud-services/chrome 2.3.1, @redhat-cloud-services/types 3.6.1, and other 30 malicious versions
  • [Package names ] affected packages – @redhat-cloud-services/frontend-components, @redhat-cloud-services/frontend-components-utilities, and other 30 packages
  • [URLs ] runtime download source – github.com/oven-sh/bun/releases, GitHub API endpoints used for exfiltration
  • [Environment variables ] credential targets – AWS_ACCESS_KEY_ID, GITHUB_TOKEN, and other cloud or CI/CD secrets such as AZURE_VAULT_NAME and GITHUB_WORKFLOW_REF
  • [File paths ] local secret locations – ~/.npmrc, ~/.ssh/, and cloud credential files used by the payload


Read more: https://www.reversinglabs.com/blog/red-hat-cloud-service-npm-packages-backdoored-in-72-seconds