Microsoft's Official Python Agent Framework Hijacked to Steal Cloud Credentials and Developer Secrets
Attackers successfully hijacked two versions (1.26.1 and 1.26.2) of Microsoft's official `agent-framework` Python package on PyPI. These malicious packages contained credential-stealing malware designed to harvest a wide array of sensitive information, including environment secrets, cloud credentials (Azure, AWS), package manager credentials (npm, PyPI, NuGet, Docker), and tokens for services like GitHub, Hugging Face, and OpenAI. The payload was particularly insidious as it executed automatically upon any Python interpreter startup, without requiring the package to be explicitly imported, making detection difficult. The malware then exfiltrated the collected data to an attacker-controlled webhook.
This incident is highly significant for cloud and DevOps practitioners because it represents a direct compromise of a trusted, official software component within the development ecosystem. The automatic execution mechanism means that simply having the compromised package installed on a system, including CI/CD build agents, could lead to a full compromise of associated cloud environments and developer accounts. The broad scope of targeted credentials underscores the potential for lateral movement and widespread impact across an organization's infrastructure. This attack specifically targets the AI developer ecosystem, indicating a growing trend where attackers are focusing on the tools and pipelines used to build and deploy AI applications.
This event fits into a broader, well-established trend of software supply chain attacks. We've seen similar compromises in open-source repositories, where malicious code is injected into widely used libraries. The increasing reliance on third-party packages and automated build processes creates a fertile ground for such attacks. The targeting of AI-related tokens (OpenAI, Hugging Face) also aligns with the growing value of AI assets and the increasing sophistication of AI-powered attackers. This incident echoes previous warnings about the fragility of the software supply chain and the need for robust security measures throughout the development lifecycle.
In practice, practitioners must immediately check all their environments, CI/CD images, and lockfiles for `agent-framework==1.26.1` or `agent-framework==1.26.2` and remove them. It is crucial to treat every secret reachable from any host where these packages might have run as compromised. This necessitates a comprehensive rotation of Azure service principal secrets, personal access tokens, and all other affected credentials (GitHub, npm, PyPI, NuGet, Docker, Hugging Face, OpenAI). Furthermore, organizations should review Azure sign-in and activity logs for any suspicious use of managed identities and federated credentials from affected build agents. Implementing strict supply chain security practices, such as pinning dependencies to verified releases with hash checking and blocking suspicious outbound traffic from build infrastructure, is no longer optional but a critical defense mechanism.
Read original source