SecPod

Learn Search

Search across all Learn content

← Back to Security Research
Worm in the Code: npm Supply Chain Attack Compromises 40+ Packages

Worm in the Code: npm Supply Chain Attack Compromises 40+ Packages

A major supply chain attack has been uncovered in the npm ecosystem, where more than 40 widely used packages were found compromised. The campaign, powered by a self-replicating malware dubbed “Shai-Hulud”, is actively spreading and exfiltrating sensitive credentials. Developers and organizations usi...

Sep 17, 2025By Ankireddy Sai Sandeep Reddy3 min read

A major supply chain attack has been uncovered in the npm ecosystem, where more than 40 widely used packages were found compromised. The campaign, powered by a self-replicating malware dubbed “Shai-Hulud”, is actively spreading and exfiltrating sensitive credentials. Developers and organizations using npm must take immediate action to secure their environments.

Vulnerability Details

The attack leverages a worm-like payload injected into legitimate npm packages. Once installed, the malware scans for developer and CI/CD secrets such as GitHub and npm tokens, then uses them to publish further malicious package versions. This self-propagating mechanism allows the compromise to spread quickly across the ecosystem, making it one of the most severe npm incidents to date.

The worm also creates malicious GitHub Actions workflows in compromised repos, enabling persistence and continuous theft of new secrets. This turns every infected maintainer into a new attack vector.

Affected Products

The Shai-Hulud attack has compromised over 180 npm packages across a wide range of popular and critical libraries used in JavaScript development. This widespread compromise impacts development environments on Windows, Linux, and macOS. Below are some of the most notable packages affected:

  • @ctrl/tinycolor: A popular color manipulation library with millions of weekly downloads; early infected package spreading the malware widely.
  • koa2-swagger-ui: Used in API documentation for Koa2 framework, trojanized versions executed malicious payloads.
  • json-rules-engine-simplified: Provides decision automation and business logic capabilities, now a vector for automated malware spread.
  • @nativescript-community/ui-material-core (and related packages): Mobile UI component libraries compromised, impacting cross-platform mobile app development.
  • ngx-toastr: Widely used Angular notification library, infected to infect front-end ecosystems.
  • react-complaint-image: React component affected, showing the breadth of the attack reaching UI and front-end packages.

Each of these packages was modified to include a malicious post-install script that automatically runs on install, harvesting secrets such as GitHub and npm tokens, credentials to cloud services, and CI/CD environment variables. Using these stolen credentials, the malware autonomously pushed infected updates to other packages under the control of the compromised maintainers, allowing rapid self-propagation.

Mitigation & Remediation

Given the active exploitation, immediate mitigation is critical:

  • Remove malicious package versions from your projects.
  • Rotate all developer and CI/CD tokens (GitHub PATs, npm tokens, cloud keys).
  • Audit repositories for unauthorized GitHub Actions workflows.
  • Patch build environments and restrict long-lived tokens.

npm maintainers should also review publishing rights and reset access credentials to prevent further abuse.

Tactics, Techniques, and Procedures (TTPs)

Attackers are exploiting the trust model of package management to execute arbitrary code in developer and CI pipelines.

  • TA0002 – Execution: Malicious code executes when installing infected npm packages.
  • T1203 – Exploitation for Client Execution: Vulnerabilities in developer environments are abused for code execution.
  • T1537 – Exfiltration: Secrets are stolen and uploaded to attacker-controlled infrastructure.

Other Vulnerabilities Addressed

This campaign has drawn attention to broader ecosystem risks. Security firms emphasize the importance of dependency hygiene, ephemeral tokens, and strict CI/CD controls to prevent future supply chain compromises.

Instantly Fix Risks with Saner Patch Management

Saner patch management is a continuous, automated, and integrated software that instantly fixes risks exploited in the wild. The software supports major operating systems like Windows, Linux, and macOS, as well as 550+ third-party applications.

It also allows you to set up a safe testing area to test patches before deploying them in a primary production environment. Saner patch management additionally supports a patch rollback feature in case of patch failure or a system malfunction.

Experience the fastest and most accurate patching software here.

Featured Posts

Open Operation CameraSwarm: Inside the Toolkit Behind 14,530 Compromised Dahua Cameras
Operation CameraSwarm: Inside the Toolkit Behind 14,530 Compromised Dahua Cameras

CVE Research

Operation CameraSwarm: Inside the Toolkit Behind 14,530 Compromised Dahua Cameras

A single operator compromised 14,530+ Dahua cameras across Ukraine and Russia in 35 days, chaining credential brute-force, a CVE-2021-33044/33045 authentication bypass, and P2P relay abuse to plant a persistent backdoor and harvest transferable admin access.

Aug 21, 2026

Open Critical GitLab Flaw Exposes Public Projects to Deletion — Two CVEs Patched, Including High-Severity CSRF
Critical GitLab Flaw Exposes Public Projects to Deletion — Two CVEs Patched, Including High-Severity CSRF

CVE Research

Critical GitLab Flaw Exposes Public Projects to Deletion — Two CVEs Patched, Including High-Severity CSRF

CVE-2026-19478 is a critical code injection vulnerability in GitLab CE/EE that allows an unauthenticated attacker to modify or delete public projects and user data by abusing a GraphQL directive. A second high-severity issue, CVE-2026-19650, involves cross-site request forgery in the GraphQL multiplex query handler. This article examines how the critical vulnerability works, the availability of a public proof-of-concept, the potential impact on self-managed instances, the affected versions, and the security updates released to remediate both issues.

Aug 19, 2026

Open No Password Needed: macOS Screen Sharing Flaw (CVE-2026-65400) Used to Deploy Monero Miners
No Password Needed: macOS Screen Sharing Flaw (CVE-2026-65400) Used to Deploy Monero Miners

CVE Research

No Password Needed: macOS Screen Sharing Flaw (CVE-2026-65400) Used to Deploy Monero Miners

Aug 19, 2026

Open Evooo1Bot: Mirai-Based Linux Botnet Turns Edge Devices Into SOCKS5 Proxies
Evooo1Bot: Mirai-Based Linux Botnet Turns Edge Devices Into SOCKS5 Proxies

CVE Research

Evooo1Bot: Mirai-Based Linux Botnet Turns Edge Devices Into SOCKS5 Proxies

Aug 19, 2026