An attacker published two credential-stealing versions of agent-framework, the Python package for Microsoft Agent Framework, to the Python Package Index on November 17. Cloud security firm Wiz said on November 18 that the attacker appears to have compromised a client certificate and private key for Microsoft’s Engineering System Release Pipeline (ESRP), the internal service Microsoft uses to sign and publish the package.
Wiz said a first publish attempt from AWS was rejected by ESRP’s IP filtering and a second, from Microsoft-owned IP space, succeeded. How the credentials were obtained is not yet known, the company said.
Version 1.26.1 went up at 20:35 UTC and version 1.26.2 about 33 minutes later. Neither was available on PyPI by about 21:30 UTC, and 1.26.0, released November 12, is the latest clean version. Wiz puts the package’s downloads at about 41,000 a week. An Agent Framework maintainer confirmed in a GitHub discussion that the releases had been removed and that an investigation was under way, SecurityWeek reported.
Both versions add a .pth startup file to the Python environment, so the stealer runs every time Python starts, even if the package is never imported. It collects environment variables with secret-looking names, values from up to 300 other processes’ environments, and credential files for the Azure CLI, npm, pip, git, Docker and Hugging Face. It also requests Azure DevOps OIDC tokens and Azure managed-identity tokens for 12 resources, including Key Vault, Storage and Microsoft Graph, and posts the results to a webhook.site address. Version 1.26.2 added theft of GitHub Actions OIDC tokens, which can be exchanged for Azure access where an Entra ID federated credential trusts the workflow.
The attacker’s tooling reported its progress to the same public webhook it used for exfiltration, which let Wiz observe part of the operation. Wiz said the tooling identifies itself as Cairn, an open-source AI penetration-testing framework. Before publishing, the attacker ran the stealer on their own machine, and that run captured an AI coding agent configuration that Wiz said appears to be the open-source Pi harness backed by a GLM-family model. Palo Alto Networks’ Unit 42 reported on November 12 that attackers had used Cairn in operations against at least 19 organizations, and Google Threat Intelligence Group has reported its use against targets including in the U.S. aerospace sector.
The webhook address was on the service’s free tier, which accepts at most 100 requests, and Wiz analyzed the 50 requests it had stored. Four came from the attacker and 29 appear linked to sandboxes, vendor scanning and tests, while the remaining 17 represent three unique, successful exfiltrations of victim data, Wiz said. Stolen managed-identity and OIDC-exchanged tokens are valid for up to 24 hours, according to Wiz.
Supply chain security firm SafeDep found that PyPI lists a second maintainer on the project: an account named vibiret that joined PyPI on November 17. The account can also publish to five related projects, four of which install with agent-framework, and still had that access on November 18. SafeDep said no upload log confirming which account published the malicious files has been released.
SafeDep said agent-framework is the second Microsoft package on PyPI to get rogue releases in six months, after durabletask versions 1.4.1 to 1.4.3 were published in May with a stolen API token. Neither firm has linked the two incidents. Wiz advises pinning to 1.26.0, rotating every credential on hosts and CI runners that installed either version, and reviewing sign-in logs for Azure identities those hosts could reach.
Sources: Wiz, SafeDep, SecurityWeek
–
By the Control Plane Editorial Team