SHARE
Facebook X Pinterest WhatsApp

Wormable Malware Triggers GitHub’s Push for Stronger npm Security

GitHub is tightening npm publishing rules after a wormable malware attack exposed weaknesses in the open source supply chain.

Sep 23, 2025
eSecurity Planet content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Open source software is the backbone of today’s digital ecosystem, powering critical applications and enabling innovation at scale. However, its openness also makes it a prime target for attackers. 

Recent events in the npm registry highlight the urgency of securing package repositories against increasingly sophisticated threats.

Recent npm Supply Chain Attacks

In September 2025, GitHub disclosed a serious incident involving the Shai-Hulud worm, a self-replicating malware that spread through compromised npm maintainer accounts. 

Attackers injected malicious post-install scripts into widely used JavaScript packages, enabling the worm to steal not only npm tokens but also a range of sensitive secrets. Left unchecked, the attack could have sparked a cascade of compromises across the software ecosystem.

GitHub responded by removing more than 500 compromised packages and blocking uploads that contained the malware’s indicators of compromise. While the immediate threat was contained, the incident underscored the fragility of supply chain trust and the ease with which attackers can weaponize open source ecosystems.

npm’s Roadmap for Security Hardening

To reduce the risk of token abuse and prevent future wormable attacks, GitHub has announced new rules for npm publishing. Key measures include:

  • Mandatory two-factor authentication (2FA) for local publishing.
  • Granular tokens with a strict seven-day lifetime.
  • Expanded adoption of trusted publishing workflows.

Legacy tokens will be deprecated, and time-based one-time password (TOTP) 2FA will be phased out in favor of stronger FIDO-based authentication. Default settings will restrict publishing access via tokens, nudging maintainers toward trusted publishing or enforced 2FA.

These changes may require workflow updates, but GitHub has committed to gradual rollouts, migration guides, and support resources to minimize disruption.

The Role of Trusted Publishing

Trusted publishing is emerging as a cornerstone of supply chain defense. This model removes the need for static API tokens in build systems. 

Instead, package repositories directly verify publishing requests from trusted continuous integration (CI) providers, closing off a major attack vector.

Although GitHub initially allowed trusted publishing adoption to grow organically, recent incidents have accelerated the push. Attackers are not waiting, and maintainers are now urged to adopt trusted publishing immediately across all supported package managers.

What Maintainers Can Do Today

Securing the npm ecosystem is a shared responsibility. While GitHub strengthens infrastructure, maintainers can take immediate steps to reduce risk:

  • Adopt trusted publishing rather than relying on long-lived API tokens.
  • Enable 2FA for all write and publish actions, ideally requiring it across accounts, organizations, and packages.
  • Use WebAuthn-based 2FA instead of weaker TOTP methods.
  • Audit publishing permissions regularly and remove unnecessary tokens or accounts.

These measures not only harden individual projects but also strengthen the resilience of the broader ecosystem.

The Bigger Picture

The Shai-Hulud worm illustrates the growing sophistication of supply chain attacks, where self-replication, token theft, and automation create powerful multipliers for attackers. With open source software embedded in nearly every enterprise, such incidents are not isolated threats but systemic risks.

The npm roadmap represents a critical shift toward identity-first controls that neutralize token abuse and reduce the blast radius of account takeovers. But technical fixes alone are insufficient. Developers, maintainers, and organizations must adopt secure defaults, invest in stronger authentication, and stay ahead of attacker innovation.

Open source thrives on trust, but as the Shai-Hulud incident demonstrates, that trust is fragile. 

By enforcing stronger publishing rules, expanding trusted publishing, and adopting modern authentication practices, GitHub and the broader community are taking essential steps toward a safer ecosystem. 

The lesson is clear: securing the software supply chain requires vigilance, collaboration, and proactive adoption of security best practices.

Recommended for you...

Ransomware’s Favorite Door? Phishing Attacks
Ken Underhill
Sep 23, 2025
Industrial Automation Threats Decline Slightly in Q2 2025, but Risks Remain
MalTerminal Malware Turns GPT-4 Into a Ransomware Factory
Ken Underhill
Sep 22, 2025
FBI Warns of Spoofed IC3 Websites Harvesting Victim Data
Ken Underhill
Sep 22, 2025
eSecurity Planet Logo

eSecurity Planet is a leading resource for IT professionals at large enterprises who are actively researching cybersecurity vendors and latest trends. eSecurity Planet focuses on providing instruction for how to approach common security challenges, as well as informational deep-dives about advanced cybersecurity topics.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.