供應鏈攻擊重挫 npm:axios 維護者帳號被盜,每週 3 億下載量全數告急

MarketWhisper

供應鏈攻擊重挫npm

安全研究機構 Socket 於 3 月 31 日偵測到 npm 核心套件 axios 遭受活躍的供應鏈攻擊。攻擊者入侵 axios 首席維護者 jasonsaayman 的 npm 帳號,發布惡意版本並注入惡意依賴包,用於投放跨平台遠端存取木馬(RAT),目標攻擊 macOS、Windows 和 Linux 系統。

攻擊鏈解析:從帳號入侵到 RAT 自毀的完整流程

axios供應鏈攻擊 (來源:Socket)

此次事件是一次精心策劃的多步驟供應鏈攻擊。攻擊者首先入侵維護者帳號,將郵箱更改為 ifstap@proton.me,然後利用盜取的 npm 存取憑證手動發布惡意版本,完全繞過了 axios 正規的 GitHub Actions + OIDC Trusted Publisher 發布流程。兩個惡意版本在 GitHub 倉庫中均無對應的提交、標籤或發布記錄。

攻擊者的準備工作同樣精密:控制另一個帳號(nrwise,nrwise@proton.me)在約 18 小時前先發布了乾淨的誘餌版本 plain-crypto-js@4.2.0 以建立歷史記錄,再於 3 月 30 日 23:59 UTC 發布了惡意的 4.2.1 版本。

惡意 postinstall hook 執行後,RAT 投放器(setup.js)連接至命令與控制服務器 sfrclak[.]com:8000 投放平台特定載荷,執行完畢後自毀並替換 package.json 為乾淨存根,令事後檢查 node_modules 目錄無法發現感染痕跡。

攻擊的關鍵技術指標(IOC)

惡意套件版本:axios@1.14.1、axios@0.30.4、plain-crypto-js@4.2.1

C2 服務器:sfrclak[.]com / 142.11.206.73 / [.]com:8000

macOS 感染痕跡:/Library/Caches/com.apple.act.mond

Windows 感染痕跡:%PROGRAMDATA%\wt.exe、%TEMP%\6202033.vbs

Linux 感染痕跡:/tmp/ld.py

攻擊者帳號:jasonsaayman(已被入侵)、nrwise(攻擊者創建帳號)

緊急應對指南:確認受影響與補救步驟

由於惡意投放器在執行後自毀,無法靠檢查 node_modules 目錄確認感染。正確方法是直接檢查 lockfile(package-lock.json 或 yarn.lock)是否包含 axios@1.14.1 或 axios@0.30.4 的版本記錄。

安全版本回退:1.x 用戶降至 axios@1.14.0;0.x 用戶降至 axios@0.30.3,並同步從 node_modules 移除 plain-crypto-js 目錄後重新安裝依賴。

若系統中發現任何 RAT 感染痕跡(com.apple.act.mond、wt.exe、ld.py),切勿嘗試就地清除,應從已知正常狀態重新建置,並立即輪換所有可能暴露的憑證,包括 npm 令牌、AWS 存取金鑰、SSH 私鑰、CI/CD 配置金鑰和 .env 檔案值。

對於加密貨幣和 Web3 開發者而言,axios 是許多 DeFi 協議前端、加密資產管理工具和鏈上數據查詢服務的核心 HTTP 庫。受感染的開發環境可能導致錢包私鑰、助記詞或 API 金鑰洩露給攻擊者,建議優先審查並輪換所有敏感憑證。

常見問題

如何確認是否安裝了受影響的 axios 版本?

由於惡意投放器在執行後自毀,不能靠 node_modules 目錄確認感染。應直接檢查 lockfile 是否含有 axios@1.14.1 或 axios@0.30.4 的記錄,並確認 node_modules 中是否存在 plain-crypto-js 目錄。可執行 npm list axios 或直接搜尋 lockfile 中的版本字串。

這次供應鏈攻擊對加密貨幣和 Web3 開發者有何特別影響?

axios 是 Web3 前端應用程式和 DeFi 協議界面的常用 HTTP 庫。受感染的開發環境可能使私鑰、助記詞、交易所 API 金鑰或 CI/CD 配置等敏感憑證暴露給攻擊者,相關開發者應優先審查並輪換所有可能暴露的加密相關憑證。

如何防範未來的 npm 供應鏈攻擊?

主要預防措施包括:在 CI/CD 中始終使用 npm ci --ignore-scripts 禁用 postinstall hook;對關鍵依賴包實施版本固定;定期審查 lockfile 的變更記錄;以及部署 Socket、Aikido 等工具進行依賴包的即時惡意軟體監控。

Disclaimer: The information on this page may come from third parties and does not represent the views or opinions of Gate. The content displayed on this page is for reference only and does not constitute any financial, investment, or legal advice. Gate does not guarantee the accuracy or completeness of the information and shall not be liable for any losses arising from the use of this information. Virtual asset investments carry high risks and are subject to significant price volatility. You may lose all of your invested principal. Please fully understand the relevant risks and make prudent decisions based on your own financial situation and risk tolerance. For details, please refer to Disclaimer.
Commento
0/400
Nessun commento