Security firm Wiz disclosed on November 17 that the agent-framework package on PyPI, from Microsoft's open-source agent development framework Microsoft Agent Framework, shipped two malicious versions: 1.26.1 and 1.26.2. Both run a credential stealer whenever Python starts, with a particular eye on tokens in Azure and CI environments. The latest safe version is 1.26.0.

A window of under an hour
According to Wiz's UTC timeline, 1.26.1 was uploaded at 20:35, 1.26.2 followed about 33 minutes later, and PyPI quarantined and pulled both at around 21:30. The previous clean release, 1.26.0, went out on November 12.
The two versions work slightly differently. 1.26.1 drops an agent_framework_meta.pth file into the root of site-packages containing a single import line. 1.26.2 restores the main package's __init__.py to a clean copy and instead launches the stealer through a newly added af_runtime_diag.pth. .pth files are executed on every Python startup, so even a project that has never imported agent-framework is triggered once the package is installed in the environment. File and function names in the code are dressed up as “telemetry” and “runtime diagnostics”, so they look like built-in SDK features.
What was taken
The theft falls into roughly three categories:
- Environment variables: any variable whose name contains TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI, HF_ and similar strings, with 1.26.2 adding ACTIONS, OIDC and RUNNER; it also goes through the environment variables of up to 300 other processes.
- Credential files:
~/.azure/,.npmrc,.git-credentials, Docker configuration, Hugging Face tokens, Azure DevOps agent credentials and more, with the two versions reading up to 60 and 80 files respectively. - Cloud tokens: requests to the Azure managed-identity endpoint for tokens covering 12 resource types, including ARM, Graph, Key Vault and storage; inside Azure DevOps and GitHub Actions workflows with the
id-token: writepermission, it also requests OIDC tokens.
The collected data is compressed, encoded and sent in a single POST to a webhook.site address. There is no fallback channel and no retry on failure.
A rough estimate of exposure
Wiz puts weekly downloads at about 41,000. That works out to roughly 240 per hour on average; with the two malicious versions live for around 55 minutes, a back-of-the-envelope estimate suggests more than 200 installs may have landed in the window. CI pipelines that do not pin versions pull the latest release automatically, and downloads are not evenly distributed, so treat the estimate as an order-of-magnitude guide only.
The number on the other side is much smaller. The attacker used the free tier of webhook.site, which accepts at most 100 requests per address and expires after 7 days, and Wiz confirmed that at most 50 requests were actually captured. Even if there were more than 200 installs, the free quota cut off some of the data that could have reached the attacker. That limit does nothing for the few dozen sets of data already taken: stolen managed-identity and OIDC tokens are valid for up to 24 hours, enough for an attacker to move laterally in the cloud.
How it happened is still unsettled
Wiz says the root cause has not been confirmed. What is known is that the GitHub repository has no tag or release for 1.26.1 and the main branch contains no malicious code; 1.26.1 exists only as a wheel, lacking the matching source distribution and core package of the same version. Wiz speculates that someone bypassed the normal release process and uploaded directly to PyPI. Wiz also notes that another Microsoft Python package, durabletask, had an incident earlier this year after a PyPI token was stolen, but it does not link the two events. As of Wiz's post, Microsoft had not responded publicly.
Wiz's remediation advice includes: pin the dependency to 1.26.0; look for the two .pth files in site-packages; check proxy and DNS logs for requests to that webhook.site address; rotate all secrets on affected hosts and CI runners; and audit sign-in records for Azure managed identities and GitHub OIDC federated credentials.
“Stolen managed-identity and OIDC-exchanged tokens are valid for up to 24 hours.”
Sources: Wiz security research blog, CocoLoop, Microsoft Agent Framework project documentation; the Wiz report was checked for the upload and removal times of the two malicious versions, the basis of the weekly download figure, and the number of requests captured by the webhook.