A serious security incident has occurred within the Python developer community, as Microsoft’s official Agent Framework package on the Python Package Index (PyPI) was compromised by attackers. The malicious actors managed to inject malware designed to steal login credentials and cloud platform tokens into the package.
Swift Action by PyPI
Fortunately, the swift response from PyPI prevented widespread damage. The compromised version, labeled 1.26.1, was live on the platform for a mere 31 minutes before being detected and removed. However, the threat wasn’t entirely neutralized, as a second malicious version, 1.26.2, was uploaded just two minutes later. This subsequent version managed to stay online for 8 minutes before it too was purged.
What is Agent Framework?
The Microsoft Agent Framework is an open-source Python toolkit that boasts nearly 200,000 monthly downloads. It empowers developers to build AI agents capable of invoking tools, following instructions, interacting with other agents, and executing complex tasks. Its popularity underscores the potential impact of such a compromise.
The Malware’s Modus Operandi
The malware embedded in version 1.26.1 was designed to execute automatically upon Python startup, irrespective of whether the Agent Framework package was explicitly imported. This stealthy approach aimed to exfiltrate sensitive information, including login credentials and cloud platform tokens, from popular services such as Azure, AWS, GitHub, Docker, Hugging Face, and OpenAI. It also sought to gather local configuration files and data from other running processes.
Second Attack Vector
The follow-up attack, version 1.26.2, introduced an additional capability: the ability to request GitHub Actions OIDC tokens. This version also included functionality to automatically scan for GitHub Runner directories, further expanding its malicious reach. While also quickly removed, the persistence of the attackers highlights the evolving nature of supply chain attacks.
Recommendations for Developers
While the exact extent of any developer information leakage remains unclear, the security team strongly advises any developers who may have downloaded versions 1.26.1 or 1.26.2 of the Agent Framework to take immediate action:
- Delete the compromised package immediately.
- Scrutinize your system for any suspicious files or processes.
- Revoke any existing login credentials, especially those related to cloud services.
- Check for any unauthorized access to services like Azure or AWS.
This incident serves as a stark reminder of the ongoing threats to software supply chains and the critical importance of vigilance within the developer ecosystem.









