Someone published two malicious versions of agent-framework, the Python meta-package for Microsoft's Agent Framework, to PyPI on November 17. Versions 1.26.1 and 1.26.2 kept the real framework code working. They also added a hook that collects secrets, cloud identity tokens and CI credentials and posts them to a webhook.site address. Aikido, JFrog and Socket each analysed the releases independently, and their findings match.
Why it matters: SecurityWeek says the package gets about 190,000 downloads a month, and it is the kind of dependency that lands in CI pipelines and Azure workloads. JFrog says Renovate opened upgrade pull requests in downstream repositories within six minutes of 1.26.1 appearing. The malicious versions are gone from PyPI, but copies may still sit in mirrors, caches, lockfiles and container images. Removing them from PyPI also does nothing about credentials that were already sent.
Timeline (November 17, UTC)
| Time | Event | Source |
|---|---|---|
| 20:35 | 1.26.1 uploaded to PyPI | Aikido, JFrog |
| 21:06 | PyPI quarantines 1.26.1 | JFrog |
| 21:08 | Attacker uploads 1.26.2 | Aikido, JFrog |
| 21:16–21:20 | Both versions removed; 1.26.0 is the latest release again | JFrog (21:16), Aikido (about 21:20) |
Aikido puts the exposure window at about 45 minutes. A Microsoft Agent Framework maintainer confirmed in a GitHub discussion that the compromised releases were removed and that an investigation is under way, SecurityWeek reports.
How it got there
Nobody has said publicly how the attacker got the right to publish. Here is what the researchers found:
- Built outside Microsoft's pipeline. JFrog says the attacker repacked the clean wheel on their own machine. Both releases were wheel-only, without the source distribution Microsoft's pipeline normally ships. Aikido found world-writable injected files and a leftover placeholder timestamp.
- Not in Microsoft's source code. SecurityWeek, citing Wiz, says no matching releases or malicious code exist in Microsoft's main repository.
- A possible new maintainer account. SecurityWeek says SafeDep found a PyPI maintainer account called "vibiret", created on the day of the attack, with publishing rights to this package and five related ones. SecurityWeek says that account's role has not been confirmed.
What the payload does
Both versions drop a .pth file into site-packages. Python runs these files every time it starts, so the stealer fires on any Python command in that environment, even if nothing imports agent_framework. On Linux and macOS it detaches into the background. On Windows it runs in a thread. In 1.26.2, the attacker restored the clean __init__.py and moved the hook into a separate top-level module, so checking only the package's own files would miss it (Socket).
According to the three analyses, it collects:
- Environment variables whose names contain strings such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB and OPENAI. JFrog says it also caught Anthropic and Gemini keys this way.
- Other processes' environments, from up to 300
/proc/<pid>/environentries on Linux. - Credential files, including Azure CLI token caches, Azure DevOps agent
.credentials,.npmrc,.netrc,.git-credentials,pip.conf, Dockerconfig.json, Hugging Face tokens, and.envand JSON files in/appand/workspace. It reads up to 60 files in 1.26.1 and 80 in 1.26.2. - Fresh Azure managed-identity tokens for 12 resources, including Resource Manager, Key Vault, Storage, Graph and Azure DevOps.
- GitHub Actions OIDC tokens (1.26.2 only), where workflows grant
id-token: write.
The data is compressed, Base64-encoded and POSTed over HTTPS. JFrog and Socket found no second stage, no persistence outside site-packages and no worm behaviour.
What to do
- Find it. Run
pip show agent-framework(or check your lockfiles) everywhere: laptops, CI runners, caches and any container image built since November 17. Look in everysite-packagesfor these files:agent_framework_meta.pthagent_framework_meta/_telemetry.pyaf_runtime_diag.pthaf_runtime_diag.py
- Neutralise before uninstalling. JFrog warns that running
pipin an infected environment triggers the stealer again. Set the payload's own guard variable first, then delete the files, uninstall and pin:
export _AF_TEL=1
pip uninstall -y agent-framework
pip install "agent-framework==1.26.0"
With uv, JFrog also says to run uv cache clean agent-framework. Watch for loose pins like agent-framework>=1.26 (Aikido).
- Rotate everything the machine could reach. That includes cloud keys, Azure service principals, Azure DevOps PATs,
SYSTEM_ACCESSTOKENvalues and service connections, and GitHub, npm, PyPI, Hugging Face, Docker and LLM API tokens. It also includes.envcontents. JFrog notes that changing passwords does not revoke cached Entra ID refresh tokens, so revoke sessions too. It also says stolen managed-identity tokens stay valid until they expire, which can take up to 24 hours. Recycle affected compute and review managed-identity sign-in logs. - Clean the supply chain. Purge the bad wheels from internal mirrors and proxies. Close or audit Renovate and Dependabot PRs from November 17, and rebuild any image that contains either version.
- Hunt in network logs. Look for POSTs to
webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb, or for the User-Agentsaf-runtime-diagnostics/1andruntime-diagnostics/1. Block webhook.site if you don't need it. Full SHA-256 hashes for both wheels are in the Aikido, JFrog and Socket posts.
What to watch
- How the attacker got publishing rights, and whether the five related packages SafeDep flagged were touched.
- Whether Microsoft publishes download counts for the two bad versions. No source we read gives them.
Sources
- Aikido — Two malicious agent-framework releases hit PyPI in 33 minutes aikido.dev
- JFrog Security Research — Microsoft's agent-framework hijacked on PyPI via silent .pth startup hook research.jfrog.com
- Socket — Microsoft's agent-framework PyPI package compromised with credential stealer socket.dev
- SecurityWeek — Microsoft Agent Framework releases poisoned with credential stealer securityweek.com