``` 事后分析:axios NPM 供应链漏洞 ```
Post Mortem: axios NPM supply chain compromise

原始链接: https://github.com/axios/axios/issues/10636

## Axios 包被攻破 - 摘要 (2026年3月31日) 2026年3月31日,由于维护者账户被攻破,恶意版本的流行 `axios` 包 (1.14.1 和 0.30.4) 曾短暂发布到 npm 注册表中。攻击者通过有针对性的社会工程攻击获取访问权限,并通过依赖项 `[email protected]` 注入远程访问木马 (RAT),影响 macOS、Windows 和 Linux 系统。 恶意软件包发布了大约 3 小时后被移除。**使用过这些版本的用户应检查他们的 `package-lock.json` 或 `yarn.lock` 文件中是否有对 `axios@(1.14.1|0.30.4)` 或 `plain-crypto-js` 的引用,如果发现,应将他们的系统视为已被攻破。** 补救措施包括降级 `axios`、删除 `plain-crypto-js`、轮换所有密钥,以及检查网络日志中是否有到可疑地址的连接。 维护者已擦除所有设备并重置凭据,并正在实施增强的安全措施,包括不可变发布和改进的身份验证 (OIDC 流程),以防止未来发生此类事件。 这凸显了开源维护者容易受到社会工程攻击,以及健全安全实践的重要性。 有关详细指南,请参阅原始报告。

## Axios NPM 供应链安全事件 - 摘要 最近一起 Axios NPM 包的入侵事件凸显了 JavaScript 供应链的脆弱性。攻击者通过钓鱼攻击(伪装成合法的会议应用程序)在维护者机器上安装了远程访问木马 (RAT),从而获得了访问权限。然后,他们直接通过 npm CLI 发布了恶意版本的 Axios,绕过了典型的基于 Git 的安全检查,例如提交签名和来源证明。 该事件表明缺乏健全的安全措施,尽管已经有像 OIDC 和提交签名这样的可用工具。虽然 Axios *已经* 采取了一些安全措施,但攻击者利用了从受损机器直接发布的能力。 讨论的重点是需要更强的安全措施,包括强制包签名、改进 npm 安全策略以及提高开发人员对社会工程学策略的认识。一些人认为验证代码的责任在于用户,而另一些人则认为维护者有责任保护他们的项目。一个关键的结论是,仅仅依赖锁定文件是不够的,主动验证依赖项至关重要。该事件还引发了关于保护 npm 生态系统挑战以及苹果操作系统在导致不安全做法中扮演的角色等方面的争论。
相关文章

原文

Date: March 31, 2026
Author: Jason Saayman
Status: Remediation in progress

On March 31, 2026, two malicious versions of axios (1.14.1 and 0.30.4) were published to the npm registry through my compromised account. Both versions injected a dependency called [email protected] that installed a remote access trojan on macOS, Windows, and Linux.

The malicious versions were live for about 3 hours before being removed.

Are you affected?

Check your lockfile:

grep -E "axios@(1\.14\.1|0\.30\.4)|plain-crypto-js" package-lock.json yarn.lock 2>/dev/null

If anything comes back, treat that machine as compromised:

  1. Downgrade to [email protected] (or 0.30.3 for 0.x users)
  2. Delete node_modules/plain-crypto-js/
  3. Rotate every secret, token, and credential on that machine
  4. Check your network logs for connections to sfrclak[.]com or 142.11.206.73 on port 8000
  5. If this happened on a CI runner, rotate any secrets that were injected during the affected build

If you were already pinned to a clean version and didn't run a fresh install between 00:21 and 03:15 UTC on March 31, you're fine.

For detailed remediation guidance, including CI/CD-specific steps, see:

What happened

The attacker gained access to the lead maintainer's PC through a targeted social engineering campaign and RAT malware. This gave them access to the npm account credentials, which they used to publish the malicious versions.

The attack followed patterns documented in similar campaigns targeting open source maintainers.

Resolution

Complete wipe of all lead maintainer devices as well as resetting of all credentials. This includes all accounts irrespective of platform, both personal and all other capacities.

What's changing

To prevent this from happening again, these are the changes being made:

Action Type
Reset of all devices and credentials Prevention
Immutable release setup Prevention
Proper adoption of OIDC flow for publishing Prevention
Improvement of overall security posture Prevention
Updating of all GitHub actions to adopt best practices Prevention

This list is not the end. We will continue actively working on improving security beyond these items.

Attack Timeline

I don't have an exact timeline for when the initial compromise occurred, but this is the sequence of events for the package itself:

  • About 2 weeks before March 31: social engineering campaign initiated against the lead maintainer
  • March 30, 05:57 UTC: [email protected] published to npm
  • March 31, 00:21 UTC: [email protected] published with [email protected] injected
  • March 31, around 01:00 UTC: [email protected] published with the same payload
  • March 31, around 01:00 UTC: first external detections
  • March 31, around 01:00 UTC: community members file issues reporting the compromise. The attacker deletes them using the compromised account.
  • March 31, 01:38 UTC: axios collaborator DigitalBrainJS opens PR chore(ci): add deprecate action; #10591 to deprecate the compromised versions, flags the deleted issues to the community, and contacts npm directly
  • March 31, 03:15 UTC: malicious versions removed from npm
  • March 31, 03:29 UTC: plain-crypto-js removed from npm

For detailed technical timelines:

Lessons learned

We are actively investigating how unauthorized access was obtained and reviewing all aspects of our security posture and access controls. While we do not have confirmed details to share at this time, this incident reinforces the need for continuous monitoring, strong account protections, and vigilance across both project infrastructure and individual maintainer environments.

We will continue to strengthen our practices in alignment with industry best practices and in collaboration with groups such as the OpenJS Security Working Group.

Security posture should be continuously monitored and improved. Specifically from this incident:

  • Publishing directly from a personal account was a risk that could have been avoided. The OIDC flow and immutable release setup we are now adopting should have been in place before this happened.
  • There was no automated way to detect an unauthorized publish. Detection depended entirely on the community noticing.
  • Open source maintainers with high-impact packages are active targets for sophisticated social engineering. Hyper vigilance is needed both on the registry and in a personal capacity.

Summary for broarder audience

We can confirm that two compromised versions of Axios were briefly made available through a widely used software download system due to unauthorized access to the lead maintainer's account, not a change to the underlying code.

We are working with the companies that operate this system, along with security experts, to investigate and contain the issue. Organizations that installed these versions should remove them immediately and treat affected systems as potentially compromised, including rotating any sensitive credentials.

This was the result of a compromised lead maintainer's account, and we are actively investigating how access was obtained. We do not have confirmed details to share at this time.

Acknowledgments

Thanks to @DigitalBrainJS for acting fast when the compromised account had higher permissions than his own and for getting npm to take action. Thanks to Open Source Community and the npm security team for their fast response.

The malicious versions have been removed from npm and are no longer infecting users. The immediate incident is resolved. We are actively working on the security improvements listed above to prevent this from happening again.

I'll update this as the investigation progresses. Questions welcome in this thread.

联系我们 contact @ memedata.com