ProBackend
Identity & Access
1 week ago5 min read

Shai-Hulud’s npm Worm: How Stolen Tokens Fueled Package Poisoning

Shai-Hulud’s npm Worm: How Stolen Tokens Fueled Package Poisoning

A September 2025 snapshot of the Shai-Hulud npm campaign: its self-propagation, credential theft and practical response steps.

The number is a snapshot, not a finish line

On September 16, 2025, researchers reported at least 187 npm packages compromised in an active supply-chain campaign. That count describes what had been identified at that moment; it shouldn’t be read as a final tally. The campaign’s defining feature was its ability to spread: a malicious package could use npm credentials available in an infected environment to publish further malicious package versions. Each newly compromised developer or build environment could therefore become another launch point. BleepingComputer

Wiz reported that malicious versions of multiple packages appeared on npm on September 15. Its researchers described the malware as a worm and connected the activity, based on victimology, to the late-August s1ngularity/Nx compromise. That is an assessment by the researchers, not proof that every affected package or organization followed the same path. Wiz

The important distinction is between a package count and the blast radius. A compromised release can be removed or superseded; credentials and code accessed during installation may remain exposed. And when a stolen token can publish packages, the incident stops being a problem confined to one dependency. It becomes an ecosystem propagation problem.

Installation turned access into propagation

The malicious versions included a post-install script. According to Wiz, that payload searched for sensitive information, including by using TruffleHog, and harvested environment variables and cloud credentials exposed through instance metadata when available. The exact data accessible would depend on what was present in the environment and which permissions those credentials carried. Wiz

The worm-like behavior matters most here. When the payload found npm tokens, it could use them to publish malicious versions of packages the token could access. A developer might install a compromised dependency while holding credentials for unrelated packages; those credentials could turn a single install into a second compromise. That’s why “we only use one affected library” is not a sufficient impact assessment. The environment around the install matters too. BleepingComputer Wiz

This also makes ordinary dependency review less straightforward. A package list can tell a team whether it pulled a reported malicious version, but it cannot by itself establish whether a developer machine or CI runner exposed a token during installation. Teams need to look at both sides: which versions were installed, and what those machines could reach.

GitHub became another attack surface

Wiz’s analysis describes a payload that validated collected credentials and used GitHub access in several ways. It created public repositories named “Shai-Hulud” containing collected secrets, and added a GitHub Actions workflow to accessible repositories. The workflow was intended to expose repository secrets. The researchers also observed private organizational repositories being migrated to public personal repositories with a “Shai-Hulud Migration” description and a “-migration” name suffix. Wiz

Those findings make the incident more than npm publishing abuse. A stolen GitHub token can grant access beyond source code: repositories, automation workflows, and secrets used by deployment or other services may all be in scope, depending on token permissions. Wiz reported finding exposed secrets in workflow logs and repositories, including GitHub and npm credentials and other API keys. Its observed counts—such as the repositories and users it identified—are research observations, not a complete census of all affected accounts. Wiz

Wiz also noted a constraint on one exfiltration route: the webhook service used by the malicious workflow had a limit and was deactivated after excessive activity. That did not make exposure harmless. The researchers said secrets could still appear in GitHub workflow logs. A failed or throttled collection endpoint doesn’t undo a credential leak that has already been written somewhere else. Wiz

Respond to the credentials, not just the package

Start by checking dependency manifests and lockfiles against the point-in-time lists of malicious versions published by researchers. Include developer workstations and CI runners in the review; don’t limit it to production images. If an affected version was installed, remove the compromised installation and move to a clean release, following vendor guidance. Wiz specifically advised removing malicious versions, cleaning the npm cache, and upgrading to a clean release. Wiz

Then treat credentials available to the affected environment as potentially exposed. Revoke and replace npm tokens, GitHub tokens, SSH keys, API keys, and relevant environment secrets where exposure is plausible. Rotation should be followed by a check that old credentials no longer work; replacing a secret without revoking the original leaves the door open. The precise set depends on what the machine could access and what logs or artifacts show. Wiz

Inspect GitHub for unexpected repositories named “Shai-Hulud,” repositories described as “Shai-Hulud Migration,” unfamiliar public copies of private repositories, and suspicious branches or workflow changes. Review audit logs for unexpected API activity, and examine workflow logs for credentials that may have been printed or transmitted. Preserve relevant evidence for investigation while containing the access; deleting a suspicious repository alone doesn’t rotate secrets that may already have escaped. Wiz

Finally, examine CI and developer environments for unexpected child processes and API calls. Limit package-publishing tokens to the packages and workflows that require them, and avoid making long-lived credentials broadly available during dependency installation. These controls won’t make malicious packages impossible, but they reduce the number of doors a post-install script can open.

The uncomfortable lesson is about trust boundaries

Package registries make sharing code easy. They also concentrate trust in maintainers, release pipelines, and credentials that can publish updates. Shai-Hulud showed how an attacker could exploit that trust recursively: compromised code harvested access, then used access to poison more packages. The practical lesson isn’t to stop using npm. It’s to treat package installation as code execution and to keep publishing and repository credentials out of environments that don’t need them.

A clean dependency tree is only the beginning of recovery. If an infected environment held tokens, the incident response has to follow those tokens into package publishing, GitHub, CI, and any services whose secrets were available there. The package may be gone; the access it borrowed may not be.

the number is a snapshot, not a finishthe number is a snapshot, not a finish