
Earlier this year on September 25, the open-source software community was hit by a supply chain attack called Sha1-Hulud, in which a self-replicating worm heavily impacted the NPM ecosystem by compromising hundreds of open-source software packages.
After gaining initial access to a victim’s endpoint via the compromised third party package, the malicious script scanned the environment for credentials including GCP, AWS, Azure, and GitHub Personal Access Tokens. Once found, the data was exfiltrated to the endpoint controlled by the threat actor. On November 24th, Sha1-Hulud returned with a new version. Here is what you need to know.
Sha1-Hulud 2.0 uses a layered, multi-stage infection process designed to blend into normal package installation workflows. By abusing npm lifecycle scripts, and harvesting cloud and GitHub credentials, the worm can silently compromise a developer’s environment and spread across the broader ecosystem.
package.jsonWhen a package is compromised, two files are added to the root directory of the package:
setup_bun.jsbun_environment.jsThe infection is triggered by the following preinstall script that is added to package.json of the compromised package.

After a victim executes npm install, npm will execute lifecycle scripts where preinstall scripts will execute first (before the actual install). The same behavior will take place even if the victim is not directly interacting with the infected package and the package is coming as a transitive dependency; or if the installation fails, the preinstall script will run first.
setup_bun.jssetup_bun.js serves as an entry point. Its main objective is:


PATH to make sure Bun binary is useablebun_environment.js using Bun
bun_environment.jsThis is a heavily obfuscated JS file, over 200K lines of obfuscated code, and it is the heart of a Sha1-Hulud 2.0 worm. Its purpose is to:


Sha1-Hulud: The Second Coming.cloud.json contents.jsonenvironment.jsontruffleSecrets.jsongithub/workflows directory containing discussion.yaml file

discussion.yaml RUNNER_TRACKING_ID: 0 - known trick to suppress runner telemetry or GitHub tracking featuresrun: echo ${{ github.event.discussion.body }} - used to verify code execution. echo can be replaced with any arbitrary command

Remediations steps should include the following:
npm install for automated environments
After reading how Sha1-Hulud 2.0 is infecting projects across the NPM ecosystem and the possible damage, you probably understand that an endpoint can be compromised even if it does not interact with the infected package directly. It is enough to build an artifact containing an infected package as a transitive dependency to get infected by the NPM worm, and we all know how easy it is to miss that!
At Minimus, we make sure our images are built using trusted and verified OSS and third party components. By controlling the entire supply chain, endpoints utilizing our images are protected from such supply chain attacks. This eliminates a major source of stress for DevSecOps teams and developers, allowing them to rely on images that are secure by default rather than struggling to build safe, non-vulnerable image versions on their own.
Try our secure-by-default images today and minimize your exposure to supply chain threats.

Start using Echo's hardened container images today.