資安公司還原Bitwarden CLI事故發生經過,駭客滲透工程師GitHub帳號而得逞
資安公司StepSecurity指出,這起事故最初是1名Bitwarden工程師的GitHub帳號被入侵,駭客在儲存庫建立新分叉(Branch),存放事先建構完成的惡意Tarball檔案,然後竄改工作流程,透過NPM儲存庫的API,將GitHub Actions的OIDC權杖(Token)交換為NPM身分驗證權杖。接著,工作流程利用交換而來的權杖將Tarball檔案發布到NPM,得逞後駭客刪除所有工作流程的運行記錄、分支與發布標記。
一旦使用者下載惡意套件並安裝,電腦就會在系統背景下載JavaScript執行環境Bun,啟動大小為9.7 MB的憑證竊取工具bw1.js。駭客鎖定SSH金鑰、NPM與GitHub權杖、AWS與GCP憑證、Shell執行記錄、環境變數,以及AI工具的組態設定檔案。StepSecurity強調,這是首度在駭入NPM生態且明確針對AI程式碼工具的活動,並將MCP伺服器視為主要竊取資料的目標,駭客針對的AI工具,涵蓋Claude Code、Cursor、Kiro、Codex CLI與Aider。
駭客得逞後,惡意軟體就會將竊得資料以AES-256-GCM演算法進行加密處理,傳送到冒充資安公司Checkmarx的網域audit.checkmarx.cx。然而,若是該網域遭到阻擋,惡意軟體會透過以GitHub為基礎的備用C2通道,將檔案傳送給攻擊者。
一旦有效酬載於受害環境取得經身分驗證的GitHub權杖,就會從竊取機密的活動升級,變成主動濫用。首先,此惡意軟體會找出權杖能寫入的所有儲存庫,以及能夠存取的GitHub Actions機密資料,然後再於儲存庫建立新的分叉,並注入惡意工作流程檔案,藉此在新的工作流程執行過程蒐集更多機密資料。
Bitwarden CLI Hijacked on npm: Bun-Staged Credential Stealer Targets Developers, GitHub Actions, and AI Tools - StepSecurity
@bitwarden/cli@2026.4.0 — the official command-line interface for the Bitwarden password manager — was found compromised on npm. A malicious preinstall hook silently bootstraps the Bun JavaScript runtime and launches a 9.7 MB obfuscated credential stealer that targets developer secrets, GitHub Actions environments, and — explicitly — AI coding tool configurations including ~/.claude.json and MCP server configs. All stolen data is encrypted with AES-256-GCM and exfiltrated to audit.checkmarx.cx, a domain impersonating the legitimate security company Checkmarx. When GitHub tokens are found, the malware weaponizes them to inject malicious workflows into repositories and extract CI/CD secrets — turning a single compromised developer machine into a supply chain attack pivot point.
www.stepsecurity.io
Comments (0)