Compromised Microsoft agent-framework releases on PyPI ran a credential stealer on every Python start, aimed at Azure and CI secrets

Two malicious agent-framework versions were up for under an hour on Nov. 17. Beyond stored secrets, they requested fresh Azure tokens, so identity logs need review.

Identity log showing fresh Azure tokens issued, beside the two compromised agent-framework versions

Companies whose builds or servers installed agent-framework 1.26.1 or 1.26.2 from PyPI on Nov. 17 must audit Azure and CI identities, because the malware requested fresh tokens that rotating stored secrets does not cancel.

What happened

Wiz said version 1.26.1 of Microsoft's agent-framework package went up at 20:35 UTC (3:35 p.m. ET) on Nov. 17, and 1.26.2 at 21:08 UTC (4:08 p.m. ET). By 21:30 UTC (4:30 p.m. ET) both were gone from PyPI, Wiz said. Those times come from Wiz alone. As of 5:10 p.m. ET Nov. 18, PyPI lists 1.26.0, published Nov. 12, as the latest release, and 1.26.1 and 1.26.2 return 404, so they were removed. Wiz calls 1.26.0 the last safe version.

The stealer ran from a .pth file in site-packages. Wiz said Python runs those files on every interpreter start, so it fires whenever Python starts in that environment, even if the package is never imported. OX Security found that the package also pulled in the genuine agent-framework-core 1.26.0, so the application keeps working.

Wiz said the stealer collected secret-like environment variables, values from up to 300 /proc environments, and credential files. It also asked Azure for new tokens: managed-identity tokens from IMDS or the App Service identity endpoint for 12 resources, including ARM, Graph, Key Vault, Storage and Container Registry, and Azure DevOps OIDC tokens. Version 1.26.2 added GitHub Actions OIDC tokens in workflows with id-token: write. Where an Entra ID federated credential trusts the workflow, Wiz said, those tokens can be exchanged for Azure access with no stored secret. Everything left in one HTTPS POST to webhook.site. Wiz said stolen managed-identity and OIDC-exchanged tokens are valid for up to 24 hours.

Who is affected

In our reading, the Linux paths point the risk at build agents, containers and Azure compute that resolved agent-framework unpinned in that hour. Wiz puts the package at about 41,000 downloads a week, a popularity figure, not a victim count. Wiz said a maximum of 50 requests to the attacker's free-tier endpoint were captured; 17 of them represent three unique, successful cases of exfiltration of victim data. That is only what was stored; the true number is unknown.

How did the attacker publish through Microsoft?

Wiz said the attacker "appears to have compromised" a client certificate and private key for Microsoft ESRP, the service Microsoft uses to sign and publish the package; how is "not yet known". Wiz said a first publish attempt from AWS was rejected by ESRP's IP filtering and a second, from Microsoft-owned IP space, succeeded. In our reading, the "official publisher" label gave buyers no protection here, and IP allow-listing alone did not stop an attacker holding what appears to be a compromised ESRP client certificate. Wiz said it reported the findings to Microsoft on Nov. 17. As of Nov. 18, neither Wiz nor OX says whether other ESRP-published packages are affected.

What to do now

Our recommendations:

  • Platform team, today: search lockfiles, CI logs, virtualenvs and container images for 1.26.1 and 1.26.2 (Wiz's step) and pin 1.26.0. Look for both file sets: agent_framework_meta.pth and agent_framework_meta/_telemetry.py for 1.26.1, af_runtime_diag.pth and af_runtime_diag.py for 1.26.2, plus the environment variable _AF_TEL=1; searching only 1.26.1 names misses 1.26.2, Wiz said. Wheel SHA256 values: d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110 (1.26.1), 3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9 (1.26.2).
  • SOC, today: search proxy and DNS logs for hxxps://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb and the user agents af-runtime-diagnostics/1 and runtime-diagnostics/1. Wiz said a 200 means that host's data was accepted, and a 410 or 429 suggests it was rejected. OX advises blocking webhook.site from build infrastructure.
  • Identity team, today: rotate every secret in the environment of affected hosts and runners, from a clean machine. Then review sign-in and activity logs for managed identities and federated credentials reachable from affected VMs, App Services, AKS nodes and pipelines (Wiz's step), covering the 24-hour token life. For 1.26.2 in GitHub Actions, review the Entra federated credentials that trust those repositories. Our earlier piece on attackers signing in as Azure apps covers the same identity steps.
  • Platform team, this month: install with pip --require-hashes and add a release-age rule so builds skip packages published an hour ago: pip --uploaded-prior-to (for example P3D) or uv exclude-newer. Narrow federated-credential subjects.

More in News

All in this topic