LeadDev 09月30日 19:07
npm蠕虫攻击,软件供应链安全面临严峻挑战
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

近期,一个自我复制的蠕虫通过npm平台侵入了超过180个包,窃取了维护者和开发者的凭证。由于许多受影响的包位于依赖链深处,此次攻击可能已波及数千个下游应用程序。被称为“Shai-Hulud”的攻击,是今年对npm的最 aggressive 的供应链攻击,警示工程领导者不能将包安全视为一项简单的检查任务。

🔍 攻击者利用被盗的npm令牌或受感染的维护者账户,将恶意代码添加到受影响的包中,并推送到注册中心。当开发者将包拉入项目时,安装脚本会自动运行并扫描本地环境中的凭证、云令牌和访问密钥。

🔗 恶意软件运行TruffleHog工具,搜索AWS、GCP、Azure服务凭证、GitHub个人访问令牌、云元数据端点和npm认证令牌,为攻击者提供升级访问权限的清晰路径。

🐛 攻击者使用发现的任何有效npm令牌,将自己重新发布到受感染维护者控制下的其他包中,实现自动化横向传播,无需手动攻击每个新目标。

📢 攻击活动还广播其发现,将窃取的密钥发布到公共GitHub存储库,并使用GitHub Actions将数据发送到攻击者控制的端点。

🚨 此次攻击表明,供应链安全不能等到事故发生后才处理。了解你的依赖项,锁定它们,并严格控制构建管道的权限。修剪未使用的包、旋转凭证和扫描密钥等日常任务应该是日常开发的一部分,而不是在出问题时才手忙脚乱。

You have 1 article left to read this month before you need to register a free LeadDev.com account.

Estimated reading time: 3 minutes

A fast-moving worm has compromised more than 180 npm packages – and may mark a turning point for software supply chain security

After years of high-profile package compromises – from event-stream to the recent Nx breach – npm is once again in the spotlight. Over the past week, a self-replicating worm has made its way through the world’s largest JavaScript package repository, compromising at least 180 packages and exposing credentials from maintainers and developers along the way. 

Because many of the affected packages sit deep in dependency chains, the attack is likely to have touched thousands of downstream applications and developers – far more than the raw number of packages suggests.

The campaign, now dubbed “Shai-Hulud” – yes, after the sandworms from Dune – represents the most aggressive supply chain attack on npm this year, and a warning shot for engineering leaders who still treat package security as a box-ticking exercise.

A worm that spreads itself

The attack itself is both clever and frighteningly efficient. It begins with a stolen npm token or compromised maintainer account, often phished or leaked in a past breach. Malicious code is added to the affected package and pushed to the registry. When developers pull the package into a project, its installation script runs automatically and scours the local environment for credentials, cloud tokens, and access keys.

Before moving to the next stage, the malware runs the TruffleHog, an open-source secret scanning tool, to hunt for Amazon Web Services (AWS) keys, Google Cloud Platform (GCP) and Microsoft Azure service credentials, GitHub personal access tokens, cloud metadata endpoints, and npm authentication tokens, giving the attacker a clear path to escalate access.

Then comes the worm-like behaviour: it takes any valid npm tokens it discovers and uses them to republish itself into other packages under the compromised maintainer’s control. This lateral spread is largely automated, meaning the attacker doesn’t need to manually compromise each new target. The campaign also broadcasts its findings, publishing stolen secrets to public GitHub repositories and using GitHub Actions to send data to attacker-controlled endpoints. In some cases, private source code repositories were made public during exfiltration, compounding the impact.

According to Aikido malware researcher Charlie Eriksen, the same attacker behind the late-August Nx compromise appears to be responsible for Shai-Hulud. In that earlier campaign, developers’ secrets were dumped onto public GitHub pages, foreshadowing the more aggressive tactics now being used.

“The scale, scope and impact of this attack is significant,” Eriksen said. “The attackers are using the same playbook in large parts as the original attack, but have stepped up their game.”

That Nx attack relied on credential theft and manual publishing, and was disruptive enough that many teams scrambled to rotate credentials and audit build pipelines. Shai-Hulud takes those same tactics and supercharges them with automation, showing how quickly attackers are iterating. Where Nx was a single-package incident, this campaign demonstrates what happens when compromise turns worm-like and spreads without human intervention.

A stress test for software supply chains

The fallout is still being tallied. Security teams are rushing to revoke tokens, remove compromised versions, and audit CI/CD pipelines. Packages linked to major vendors, including CrowdStrike, have been caught in the crossfire, a stark reminder that even mature security organisations are not immune to supply chain risk.

For engineering leaders, this is more than just another npm scare. It’s a stress test of organizational readiness for supply chain attacks that propagate automatically, harvest secrets at scale, and exploit the trust inherent in open source software ecosystems.

The message is clear: supply chain security can’t wait until after an incident. Know your dependencies, lock them down, and keep build pipelines tightly permissioned. Routine tasks like trimming unused packages, rotating credentials, and scanning for secrets should be part of day-to-day development, not a scramble when things go wrong.

The npm ecosystem isn’t going anywhere, and attackers know it. Shai-Hulud shows that writing code is only half the job – protecting the pipelines that ship that code is just as critical.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

npm 软件供应链安全 蠕虫攻击 凭证盗窃 TruffleHog
相关文章