Microsoft’s agent-framework package on PyPI briefly carried a credential stealer
- Affected
- agent-framework
1.26.1and1.26.2on PyPI, both now removed. All versions and fixes
- Vendor
- Microsoft
Two versions of agent-framework, the PyPI package for Microsoft Agent Framework, carried a credential stealer on Nov 17, Wiz says. Versions 1.26.1 and 1.26.2 went up at 3:35 p.m. and about 4:08 p.m. ET, and both were gone by 4:30 p.m. ET. Each runs its stealer whenever Python starts, even if the package is never imported, and sends Azure, CI and registry credentials to a webhook[.]site address. The last safe version is 1.26.0.
Each version drops a .pth file into the site-packages folder: in 1.26.1 and in 1.26.2. Python runs such files every time it starts, so the stealer runs in that environment whether or not agent-framework is used. It forks into the background and names itself like SDK telemetry. Searching only for the first version’s file names misses the second, Wiz notes.
The stealer collects environment variables whose names suggest secrets, secret-looking values from other processes’ environments, and up to 60 credential files. Those include Azure CLI, npm, pip, git, Docker and Hugging Face credentials and Azure DevOps agent files. It also requests Azure DevOps OIDC tokens and Azure managed-identity tokens for 12 resources, including Graph and Key Vault. Version 1.26.2 adds GitHub Actions OIDC tokens, which can be exchanged for Azure access where Entra ID trusts the workflow.
How the attacker got publishing access isn’t confirmed. Microsoft’s GitHub repository has no matching tag or release, and 1.26.1 shipped as a wheel only, without the source package and matching agent-framework-core release that real versions have. Wiz says that suggests an upload outside the project’s normal release process. Another Microsoft Python package, durabletask, was compromised earlier this year through a stolen PyPI token, but Wiz hasn’t linked the two.
The package gets about 41,000 downloads a week. The attacker’s webhook[.]site address was on the free tier, which accepts at most 100 requests, and Wiz confirmed that no more than 50 were captured. Those requests can still hold working cloud, CI and registry credentials. Stolen managed-identity and OIDC-exchanged tokens stay valid for up to 24 hours, Wiz notes.
- Vendor
- Microsoft
What to do
6 steps
- 2 Look in site-packages for agent_framework_meta.pth, agent_framework_meta/_telemetry.py, af_runtime_diag.pth or af_runtime_diag.py, since any Python process started there ran the stealer.
Affected and fixed versions
| Product | Affected | Fixed |
|---|---|---|
| agent-framework on PyPI | 1.26.1 and 1.26.2 | 1.26.0, the last safe version |
- Product
- agent-framework on PyPI
- Affected
1.26.1and1.26.2- Fixed
1.26.0, the last safe version
Indicators
URLs copy defanged. Use Copy raw for queries.
| Type | Value | Note |
|---|---|---|
| URL | Exfiltration endpoint, called with ?t=telemetry | |
| User agent | Exfiltration user agent in 1.26.1 | |
| User agent | Exfiltration user agent in 1.26.2 | |
| File name | Startup hook in site-packages, from 1.26.1 | |
| File name | Credential stealer, from 1.26.1 | |
| File name | Startup hook in site-packages, from 1.26.2 | |
| File name | Credential stealer, from 1.26.2 | |
| SHA-1 | _telemetry.py | |
| SHA-256 | af_runtime_diag.py | |
| SHA-256 | af_runtime_diag.pth | |
| SHA-256 | agent_framework-1.26.1-py3-none-any.whl | |
| SHA-256 | agent_framework-1.26.2-py3-none-any.whl |
- URLExfiltration endpoint, called with ?t=telemetry
- User agentExfiltration user agent in 1.26.1
- User agentExfiltration user agent in 1.26.2
- File nameStartup hook in site-packages, from 1.26.1
- File nameCredential stealer, from 1.26.1
- File nameStartup hook in site-packages, from 1.26.2
- File nameCredential stealer, from 1.26.2
- SHA-1_telemetry.py
- SHA-256af_runtime_diag.py
- SHA-256af_runtime_diag.pth
- SHA-256agent_framework-1.26.1-py3-none-any.whl
- SHA-256agent_framework-1.26.2-py3-none-any.whl
Timeline
- Nov 12The legitimate agent-framework
1.26.0is published on PyPI. - Nov 17Malicious
1.26.1goes up on PyPI at 3:35 p.m. ET. - Nov 17Malicious
1.26.2follows at about 4:08 p.m. ET. - Nov 17Both versions are gone from PyPI by about 4:30 p.m. ET.
- Nov 17Wiz publishes its analysis.
Sources
- Wiz researchPrimary source wiz.io
- Aikido researchPrimary source aikido.dev