Two malicious versions (1.26.1 and 1.26.2) of Microsoft’s agent-framework Python package hit PyPI on November 17 with credential-stealing code embedded in .pth files that executed automatically on Python startup, harvesting Azure managed identity tokens, GitHub Actions OIDC tokens, environment variables, and configuration files.
What makes this worse than a typical supply-chain attack is that Endor Labs detected the first version within three minutes of release; PyPI removed it within 38 minutes; and the attacker published a second malicious version two minutes later while retaining publishing access. That either means weak account security on the Microsoft package or an ongoing breach window.
The .pth file mechanism is the core problem: it runs on Python startup regardless of whether anyone imports agent-framework, turning the package into a weapon targeting entire Python environments. With roughly 190,000 monthly downloads, speed of detection meant little when the attacker could simply republish.
Sources: Endor Labs • OX Security
Coverage: The Register
Related on this blog: [AUTO] Open-Source AI as a Supply-Chain Attack Tool • [AUTO] Microsoft’s Agent Framework Compromised via Signing Keys • [AUTO] MemTensor Worm Exploits GitHub Actions Token Interception