Hacker News 中文摘要

RSS订阅

DuckDB NPM 包 1.3.3 和 1.29.2 遭恶意软件入侵 -- DuckDB NPM packages 1.3.3 and 1.29.2 compromised with malware

文章摘要

DuckDB的Node.js npm包1.3.3和1.29.2版本被恶意代码攻击,影响了四个包,恶意代码旨在干扰加密货币交易。团队在四小时内发现并采取了措施,包括弃用受影响版本、联系npm删除这些版本,并重新发布了安全版本1.3.4和1.30.0。用户应避免更新到受影响版本。

文章总结

DuckDB NPM 包 1.3.3 和 1.29.2 被植入恶意软件

DuckDB 在 NPM 上发布的 Node.js 版本被发现植入了恶意软件,影响了以下四个包的特定版本:

  • @duckdb/node-api@1.3.3
  • @duckdb/node-bindings@1.3.3
  • duckdb@1.3.3
  • @duckdb/duckdb-wasm@1.29.2

这些恶意代码旨在干扰加密货币交易。值得注意的是,DuckDB 的当前版本为 1.3.2,1.4.0 版本预计于 2025 年 9 月 10 日发布,且官方从未计划发布“合法”的 1.3.3 版本。用户应确保不会意外更新到受影响的版本。

DuckDB 团队在事件发生后的四小时内迅速采取了以下措施:

  • 立即将受影响的版本标记为弃用
  • 联系 NPM 支持团队删除受影响的版本,并成功完成删除。
  • 重新发布了更高版本的 Node 包(1.3.4/1.30.0),以确保最新版本指向安全版本。

团队对此事件深表歉意,并正在审查内部流程,以确保未来版本的安全性。

事件回顾

9 月 8 日,DuckDB 维护者收到了一封来自 [...@npmjs.help 的邮件,邮件内容看似合理。维护者点击了邮件中的链接,进入了一个与 NPM 官网几乎一模一样的钓鱼网站。维护者使用 duckdb_admin 账户登录并重置了双重认证(2FA)。实际上,钓鱼网站将操作转发到了真正的 NPM 网站,因此 2FA 也被更新。然而,攻击者还添加了一个新的 API 令牌,并利用该令牌发布了恶意包版本。

事后看来,浏览器未自动填充登录信息本应是一个警示信号。团队承认这是一次典型的钓鱼攻击,并再次为此道歉。幸运的是,团队在事件发生后的几小时内发现了问题,并在早上 7 点召开了紧急会议进行响应。团队及时更新了密码、令牌和 API 密钥,避免了更严重的后果。

评论总结

评论总结:

  1. 关于恶意包的发布与影响

    • 有评论指出攻击者发布了包含恶意代码的DuckDB包,干扰加密货币交易。
      • 引用:"An attacker published new versions of four of duckdb’s packages that included malicious code to interfere with cryptocoin transactions"
    • 另一评论质疑npm统计数据,认为在恶意版本发布的4小时内,没有人更新这些包。
      • 引用:"Packages with weekly downloads in the hundreds of thousands, yet in the 4+ hours that the malicious versions were up for, not a single person updated any of them to the latest patch release?"
  2. npm的安全性问题

    • 有评论认为npm已成为“依赖地狱”的代表,安全问题频发。
      • 引用:"Comes with the territory considering that npm is defacto the number one enshittification dependency by now."
    • 另一评论建议npm应引入“冷却期”,允许新版本发布后延迟下载,以便管理员有时间审核。
      • 引用:"Is it just me who think this could have been prevented if npm admins put in some sort of cool off period to only allow new versions or packages to be downloaded after being published by 'x' amount of hours?"
  3. 关于钓鱼攻击与用户教育

    • 有评论指出钓鱼邮件缺乏新意,但攻击者可能已成功入侵多个作者。
      • 引用:"So far, it seems to be a bog-standard phishing email, with not much novelty or sophistication, seems the people running the operation got very lucky with their victims though."
    • 另一评论建议电子邮件软件应增加链接不可点击或显示完整链接的功能,以减少钓鱼风险。
      • 引用:"Maybe email software should add an option to make links unclickable, or show a box with the clear link (and highlight the domain) before letting the user go through it."
  4. 关于2FA与身份验证的改进

    • 有评论认为当前的2FA机制不够安全,建议在更改凭证后设置24小时的发布限制。
      • 引用:"Maybe there should be a 24 hour period where nothing can be published after changing any form of credentials."
    • 另一评论建议使用Passkeys而非2FA来增强安全性。
      • 引用:"Should enforce passkeys not 2FA"
  5. 关于基础设施与签名机制

    • 有评论强调npm等平台是关键基础设施,应通过签名邮件等方式提高安全性。
      • 引用:"Can package publishing platforms PLEASE start SIGNING emails. Publish GPG keys (or whatever, I don’t care about the technical implementation) and sign every god damned email you send to people who publish stuff on your platform."
    • 另一评论指出密码管理器虽然不完美,但能有效减少此类错误。
      • 引用:"I hate the janky password manager browser extensions but at least they make it hard to make this mistake."

总结:

评论主要围绕npm平台的安全性问题展开,包括恶意包的发布、钓鱼攻击的防范、2FA机制的改进以及基础设施的加固。多数评论认为当前的安全措施不足,提出了冷却期、签名邮件、Passkeys等改进建议。同时,也有评论质疑npm的统计数据,并呼吁加强用户教育和身份验证机制。