As a result of the compromise of the GitHub Actions release process in repositories owned by Red Hat, attackers were able to publish 64 malicious versions in the NPM directory, covering 32 NPM packages for the Red Hat Cloud Services platform. Two malicious versions were released for each affected NPM package, integrating code to activate a new variant of the mini-shai-hulud worm, which searches for tokens and credentials in the current environment.
The worm was located in the index.js file and was activated via a preinstall handler triggered during the installation of the affected package. After activation, the worm searched the system for tokens for NPM (~/.npmrc), PyPI, CircleCI, AWS, GCP, Docker, Azure, HashiCorp, and Kubernetes K8s, as well as private SSH keys. The discovered data was sent to the attackers. If a token for connecting to the NPM directory was found, the worm automatically published new malicious releases for the packages being developed in the current environment, affecting the dependency tree.
Access to GitHub Actions was obtained through the compromise of an account belonging to one of Red Hat's employees, allowing attackers to directly push commits to the javascript-clients, frontend-components, and platform-frontend-ai-toolkit repositories without going through a review stage. Through the commits to the continuous integration system, a ci.yaml file was injected, which, when the build job was run, executed the _index.js script using the bun platform. The script used the "id-token: write" permission to request an OIDC (OpenID Connect) token from GitHub, which was then used for authentication in NPM via the "trusted publishing" mechanism.
NPM packages containing malicious code:
- @redhat-cloud-services/chrome (2.3.1, 2.3.2)
- @redhat-cloud-services/compliance-client (4.0.3, 4.0.4)
- @redhat-cloud-services/config-manager-client (5.0.4, 5.0.5)
- @redhat-cloud-services/entitlements-client (4.0.11, 4.0.12)
- @redhat-cloud-services/eslint-config-redhat-cloud-services (3.2.1, 3.2.2)
- @redhat-cloud-services/frontend-components (7.7.2, 7.7.3)
- @redhat-cloud-services/frontend-components-advisor-components (3.8.2)
- @redhat-cloud-services/frontend-components-config (6.11.3, 6.11.4)
- @redhat-cloud-services/frontend-components-config-utilities (4.11.2, 4.11.3)
- @redhat-cloud-services/frontend-components-notifications (6.9.2, 6.9.3)
- @redhat-cloud-services/frontend-components-remediations (4.9.2, 4.9.3)
- @redhat-cloud-services/frontend-components-testing (1.2.1, 1.2.2)
- @redhat-cloud-services/frontend-components-translations (4.4.1, 4.4.2)
- @redhat-cloud-services/frontend-components-utilities (7.4.1, 7.4.2)
- @redhat-cloud-services/hcc-feo-mcp (0.3.1, 0.3.2)
- @redhat-cloud-services/hcc-kessel-mcp (0.3.1, 0.3.2)
- @redhat-cloud-services/hcc-pf-mcp (0.6.1, 0.6.2)
- @redhat-cloud-services/host-inventory-client (5.0.3, 5.0.4)
- @redhat-cloud-services/insights-client (4.0.4, 4.0.5)
- @redhat-cloud-services/integrations-client (6.0.4, 6.0.5)
- @redhat-cloud-services/javascript-clients-shared (2.0.8, 2.0.9)
- @redhat-cloud-services/notifications-client (6.1.4, 6.1.5)
- @redhat-cloud-services/patch-client (4.0.4, 4.0.5)
- @redhat-cloud-services/quickstarts-client (4.0.11, 4.0.12)
- @redhat-cloud-services/rbac-client (9.0.3, 9.0.4)
- @redhat-cloud-services/remediations-client (4.0.4, 4.0.5)
- @redhat-cloud-services/rule-components (4.7.2, 4.7.3)
- @redhat-cloud-services/sources-client (3.0.10, 3.0.11)
- @redhat-cloud-services/topological-inventory-client (3.0.10, 3.0.11)
- @redhat-cloud-services/tsc-transform-imports (1.2.2)
- @redhat-cloud-services/types (3.6.1, 3.6.2, 3.6.4)
- @redhat-cloud-services/vulnerabilities-client (2.1.8, 2.1.9)
Source: opennet.ru
