Microsoft’s agent-framework versions 1.26.1 and 1.26.2 contained credential-stealing code
The versions published on PyPI on 17 November ran a credential collector whenever Python started in an environment where they were installed, even if no code used the package. Anyone who installed them must isolate the environment before running python or pip, and rotate credentials.
Version 1.26.1 appeared on the PyPI package registry at 20:35 UTC on 17 November. The agent-framework package bundles the components of Microsoft’s Agent Framework library, which developers use to build AI agents. Endor Labs said the package is downloaded about 190,000 times a month.
PyPI quarantined the first version, but version 1.26.2 was published 2 minutes 23 seconds later, StepSecurity reported. The quarantine therefore did not immediately cut off the publisher’s access. PyPI quarantined the second version eight minutes later. The last clean version is 1.26.0.
The package added a .pth file to the site-packages directory. Python reads such files at start-up and runs their import lines. The credential collector therefore started whenever anything ran Python in the environment, including pip. Applications worked normally because the package still installed the genuine agent-framework-core.
The collector read secrets from environment variables, credential files and the environments of up to 300 other processes. It also requested new tokens from Azure DevOps and from Azure managed identity for 12 services. Version 1.26.2 requested tokens from GitHub Actions as well. StepSecurity stressed that the code shows only an attempt to obtain tokens, not that the attempt succeeded. Managed-identity tokens and Azure tokens obtained with OIDC tokens are valid for up to 24 hours, Wiz said.
Wiz analysed 50 requests recorded by the webhook.site service. Four came from the attacker, and 29 appeared to relate to sandboxes, security companies’ scans and tests. The remaining 17 belonged to three successful exfiltrations from victims. They may contain working credentials. Check your own logs for the path webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb. A response code of 200 means the data was received, while 410 or 429 points to rejection, Wiz said. StepSecurity said a connection to the domain alone does not prove a leak.
How the attacker got in has not been confirmed. Wiz assesses that the attacker obtained a certificate and key for ESRP, Microsoft’s internal release service.
Anyone who installed the versions must disconnect the environment from the network before running python or pip in it, StepSecurity and Endor Labs said. Even pip uninstall starts the collector. The environment is best rebuilt from a clean base, with credentials rotated from a clean machine. StepSecurity noted that rotation is a precaution, not proof that every credential leaked, and that it may not revoke identity tokens already issued. Wiz advises checking Azure sign-in and activity logs for use of managed identities and federated credentials. Quarantine does not remove copies already downloaded, so it is worth searching lock files, CI caches and container images for the versions. The package is best pinned to version 1.26.0 with a hash.
Read more: How an agent works · Agent map