Attackers push credential stealer into Microsoft agent-framework

Two poisoned releases of Microsoft's Python AI agent package ran on Python startup, harvested secrets and requested fresh cloud tokens before PyPI quarantined them.

SecurityPublished
What happened
Malicious versions 1.26.1 and 1.26.2 of Microsoft's agent-framework package were published to PyPI on 17 November and have since been quarantined.
What’s new
The attacker uploaded a second, more capable version minutes after PyPI quarantined the first, showing publishing access had not been cut off.
Why it matters
The malware runs without being imported and requests new cloud identity tokens, so affected build systems may need more than a password reset.

Two malicious releases of agent-framework, the Python package for Microsoft's open-source AI agent framework, were published to PyPI on 17 November, according to BleepingComputer, SecurityWeek and the security firms Socket and StepSecurity. Versions 1.26.1 and 1.26.2 carried a credential stealer. BleepingComputer puts the package at roughly 200,000 monthly downloads; SecurityWeek says about 190,000.

A second upload after quarantine

StepSecurity's timeline shows 1.26.1 uploaded at 20:35:20 UTC and quarantined by PyPI at 21:06:16 UTC. Version 1.26.2 arrived at 21:08:39 UTC, 2 minutes 23 seconds after that quarantine, and was itself quarantined at 21:16:44 UTC. StepSecurity says this shows quarantine did not immediately remove the attacker's publishing rights, but does not show whether access remains.

How the attacker got in is unknown. SecurityWeek reports that Wiz saw no corresponding release or rogue code in Microsoft's primary GitHub repository, which points to the packages having been pushed outside the usual release process. SecurityWeek also reports SafeDep spotted a maintainer account created on the day of the attack with publishing rights, though its role is unconfirmed.

According to SecurityWeek, an Agent Framework maintainer confirmed in a GitHub discussion that the releases were pulled and an investigation was under way. A Microsoft spokesperson told The Register: "We have made some repositories private while we investigate malicious content." The Register and SecurityWeek note ONNX Runtime repositories also went offline, but say no link to this attack has been established.

What the payload does

Both versions install a .pth startup hook, so the code runs whenever Python starts in the affected environment, even if the framework is never imported, the researchers say. The legitimate 1.26.0 components were kept so applications kept working. The stealer gathers secrets from environment variables, credential files and other processes, targeting services including Azure, AWS, GitHub, Docker, Hugging Face and OpenAI. Socket says it also actively requests fresh Azure managed-identity and CI federation tokens; 1.26.2 added GitHub Actions OIDC tokens. Data goes to a hard-coded webhook.site address.

The Register describes the data as encrypted, but Socket and StepSecurity say it is only compressed and base64-encoded, which they stress is not encryption.

What affected users should do

StepSecurity advises isolating any environment that installed either version before running Python or pip, rebuilding from a clean base pinned to 1.26.0, treating reachable credentials as exposed, and checking egress logs for the webhook path. It warns that changing static secrets may not cancel identity tokens already minted, so it recommends reviewing service connections and role assignments and monitoring identity logs across the exposure window.