GitHub said in a blog post it was notified on Sept. 14, 2025 of the “Shai-Hulud attack”, a self-replicating worm that infiltrated the npm ecosystem by injecting malicious post-install scripts into popular JavaScript packages. The company said the worm combined self-replication with the ability to steal multiple types of secrets and that timely action by GitHub and maintainers limited further damage.
The article said GitHub and npm responded by removing more than 500 compromised packages from the npm registry and by blocking uploads that matched the malware’s indicators of compromise. GitHub described the incident as part of a broader surge in account takeovers on package registries that can enable distribution of malicious software through trusted packages.
To reduce token abuse and the risk of self-replicating malware, GitHub said it will change authentication and publishing options to require local publishing with required two-factor authentication, to rely on granular tokens limited to seven days, and to adopt trusted publishing, among other measures.
The company said it will deprecate legacy classic tokens, phase out time-based one-time passwords in favor of FIDO-based 2FA, shorten granular token lifetimes for publishing, disallow tokens by default for publishing, remove the option to bypass 2FA for local publishing, and expand eligible providers for trusted publishing. GitHub said the changes will be rolled out gradually with timelines, documentation and migration guidance.
GitHub encouraged projects to adopt trusted publishing now and pointed to prior deployments of the approach by other registries, saying trusted publishing was pioneered on PyPI in 2023 and later added to RubyGems, crates.io and NuGet. GitHub also advised maintainers to use trusted publishing, to strengthen publishing settings to require 2FA and to use WebAuthn rather than TOTP when configuring 2FA (guidance).
GitHub framed the measures as part of a broader investment in supply chain security and said the security of the open source ecosystem is a shared responsibility.