On Tuesday (November 17), two malicious versions of the agent-framework package, the official meta-package of the Microsoft Agent Framework on PyPI, arrived carrying a credential stealer. Security firms detected versions 1.26.1 and 1.26.2 within minutes, and PyPI quarantined both releases the same day. The last clean version is 1.26.0, released on November 12.
The Microsoft Agent Framework is Microsoft's open-source toolkit for building production AI agents and multi-agent workflows. According to Wiz, the package gets about 41,000 downloads per week.
How the attack worked
The malicious code did not change the framework itself or add a malicious dependency: each wheel installed a .pth file in the site-packages directory. Python executes the import lines in those files every time the interpreter starts — so the stealer ran whenever Python launched in an affected environment, even if nothing imported Agent Framework, including while pip itself was running.
Version 1.26.1 reached PyPI at 20:35 UTC and left the index at 21:13; 1.26.2 appeared at 21:08, just over two minutes after the first quarantine, and entered quarantine at 21:16. Both carried the same stealer under different file names and sent the stolen data to the same exfiltration address.
What was stolen
According to analyses by Endor Labs, Wiz and StepSecurity, the collector requested Azure managed identity tokens for 12 resources, Azure DevOps OIDC tokens and, in version 1.26.2, GitHub Actions OIDC tokens for Azure federated credentials. It also read Azure DevOps agent .credentials files, environment variables with names containing terms such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB and OPENAI, and scraped the environment of other running processes. The main targets were CI runners and Azure workloads, although developer laptops were also in scope.
The attack hit only the meta-package: the 22 sibling agent-framework-* packages checked, including agent-framework-core, still had November 12 as their latest release.
How the attacker published the versions
Wiz says, based on watching the attacker's own tooling, that the attack appears to have used a compromised client certificate and private key for ESRP (Engineering System Release Pipeline), Microsoft's internal service for signing and publishing the package. The tooling identified itself as Cairn, an open-source AI penetration-testing framework. Microsoft had not publicly confirmed this mechanism when the analyses were written — treat it as a Wiz finding, not an established root cause.
In an update on November 18, SafeDep reported that PyPI lists a second maintainer for the project, the account vibiret, created on the day of the attack and able to publish to agent-framework and five related projects.
What to do
Anyone who installed versions 1.26.1 or 1.26.2 should rebuild the environment from a clean base, pin version 1.26.0 and rotate any credentials that may have been exposed — Azure, Azure DevOps and GitHub Actions tokens, plus secrets present in environment variables. PyPI now points to 1.26.0 as the package's latest version again.
The case comes as Microsoft investigates another supply-chain incident: the ONNX Runtime repository disappeared from GitHub, as Geekiki reported. Read also: ONNX Runtime disappears from GitHub as Microsoft investigates malicious content.
Fontes
- Endor Labs: agent-framework compromised
- Wiz: Malicious version of Microsoft's agent-framework published to PyPI
- StepSecurity: Microsoft agent-framework PyPI package compromised
- SafeDep: Microsoft agent-framework compromised twice on PyPI
- PyPI: agent-framework
Image credit: Python logo, Python Software Foundation, public domain, via Wikimedia Commons.
Transparency: this article was produced with the assistance of artificial intelligence, cross-checking public posts and sources on the internet. Consult the original sources to confirm the information.
By Muse