Malicious Agent Framework releases target cloud and CI/CD credentials
Malicious versions 1.26.1 and 1.26.2 of Microsoft’s Agent Framework Python package were uploaded to PyPI on November 17, according to Wiz and other security researchers cited in the reports. The malware was designed to run when Python started, even without importing the package, and collect credentials, cloud tokens, local configuration files and information about running processes. It targeted services including Azure, AWS, GitHub, OpenAI, Docker and Hugging Face. Version 1.26.2 also sought GitHub Actions OIDC tokens, while both releases were removed from PyPI. Researchers said it remains unknown whether the attack succeeded or whether any developers lost secrets. They advised users who installed either version to remove it, revoke and replace exposed secrets, and investigate cloud accounts and automated build environments, including GitHub Actions.
The packages were built to harvest secrets used by cloud services and CI/CD systems, including tokens that could grant access to GitHub Actions workflows and, in relevant configurations, Azure resources. The reports therefore recommend investigating build environments and rotating credentials for anyone who installed the affected versions.
微軟AI代理開發框架Microsoft Agent Framework的Python套件agent-framework遭植入惡意程式。根據資安業者Wiz的分析,攻擊者於11月17日在Python套件儲存庫PyPI發布惡意版本1.26.1及1.26.2,企圖竊取Azure雲端服務及Azure DevOps、GitHub Actions等開發與CI/CD環境所使用的身分驗證憑證。兩個版本均已從PyPI移除。根據研究人員當時的調查,最新的安全版本為1.26.0,實際受害規模則尚未確認。Microsoft Agent Framework是微軟用於開發AI代理及多代理工作流程的開源框架,其agent-framework套件每週下載量約4.1萬次。
攻擊者利用Python啟動時會處理.pth檔案的特性,讓憑證竊取程式自動執行。即使應用程式未使用Agent Framework的功能,只要在安裝惡意版本的環境中啟動Python,仍可能受到影響。該程式會搜尋環境變數及開發工具的憑證檔案,並嘗試擷取Azure受控識別的存取權杖,再將蒐集到的資料傳送至外部端點。1.26.2版還新增擷取GitHub Actions OIDC權杖的功能,鎖定具有id-token: write權限的工作流程。若Microsoft Entra ID已透過同盟身分驗證憑證設定信任相關GitHub Actions工作流程,攻擊者便可能利用竊取的OIDC權杖換取Azure存取權限。
攻擊者如何取得套件發布權限,目前仍未查明。研究人員在微軟的GitHub專案中,未找到1.26.1版的發布標籤或版本發布紀錄,也未在主要分支發現相關惡意程式碼,因此研判攻擊者可能未經正常發布流程,便將惡意版本直接上傳PyPI。Wiz建議企業檢查CI/CD紀錄、Python虛擬環境及容器映像,確認是否安裝受影響版本。若發現環境受到影響,應移除惡意程式、輪替可能暴露的憑證,並檢查Azure及GitHub Actions的存取紀錄,確認是否出現異常活動。
#Microsoft Agent Framework#Microsoft#PyPI#Azure#AWS#GitHub#OpenAI#Docker#Hugging Face#Azure DevOps#GitHub Actions#Wiz