Hijacked Microsoft Agent Framework package on PyPI hid a credential stealer
Two malware-laced releases of a Microsoft AI developer package were live on PyPI for under an hour. Researchers say anyone who installed them should rotate every exposed secret.
Key takeaways
- Malicious releases v1.26.1 and v1.26.2 were uploaded to PyPI on Nov. 17 and removed within about an hour.
- The stealer ran whenever Python started and targeted Azure, Azure DevOps and developer credentials, plus GitHub Actions tokens in v1.26.2.
- A project maintainer confirmed the removal and an investigation, SecurityWeek reports; how the attackers got in is unknown.
- v1.26.0 is the latest safe release.
- Anyone who ran the bad versions should rotate exposed secrets; uninstalling alone is not enough.
Attackers published two malicious versions of agent-framework, the official Python package for Microsoft Agent Framework, to the PyPI software registry on Tuesday, Nov. 17, according to Wiz, Socket, SecurityWeek and CSO Online. The versions, v1.26.1 and v1.26.2, carried a credential stealer aimed at cloud accounts and automated build systems. The toolkit is used to build AI agents. OX Security said the attack shows hackers going after the AI developer ecosystem and its build pipelines, CSO Online reports.
Wiz says v1.26.1 was uploaded at 20:35 UTC and v1.26.2 followed 33 minutes later. Both were gone from PyPI by about 21:30 UTC, Wiz says; Aikido Security put the removal at about 21:20 UTC, according to CSO Online. v1.26.0, released on Nov. 12, is the latest safe version.
A project maintainer said in a GitHub discussion that the bad releases were off PyPI and that Microsoft was investigating, SecurityWeek reports.
How did the malware work?
Both versions dropped a small startup file into the Python installation, so the stealer ran every time Python started in that environment, even if the package itself was never imported, according to Wiz and CSO Online. The malicious releases also kept the real framework code, so applications went on working normally and the compromise was easy to miss, SecurityWeek and CSO Online report. The code was disguised as diagnostics or telemetry.
The stealer collected environment variables whose names suggested secrets, credential files for tools such as the Azure command-line interface, Git, Docker, npm and pip, Hugging Face tokens and Azure DevOps build agent credentials, Wiz says. It also read secrets from other running processes and requested Azure managed identity tokens for services including Key Vault, Storage and Microsoft Graph. The second version added theft of GitHub Actions identity tokens that can be exchanged for Azure access where a workflow is trusted to do so, Wiz says. The data was compressed, encoded and sent to an address on webhook.site, a public request-inspection service.
Endor Labs said the payload was written mainly for build systems and Azure workloads, though developer laptops were also in scope, according to CSO Online.
How many people were affected?
That is not yet known. Estimates of the package's popularity vary: SecurityWeek puts it at about 190,000 downloads a month, while Wiz says it gets about 41,000 downloads a week. Wiz says the attacker used a free webhook.site address, which stops logging after 100 requests, and that at most 50 requests were captured. Those could still contain working cloud, build and registry credentials, Wiz warns.
How did the attackers get in?
Microsoft has not said. Wiz found no matching tag or release in Microsoft's GitHub repository and no malicious code on its main branch. Legitimate releases include both a built package and its source, while the malicious versions were built packages only, suggesting they were uploaded outside the project's normal release process, Wiz and SecurityWeek report. OX Security offered a different explanation: the attackers appear to have hijacked the step that builds the package, CSO Online reports. Microsoft has not confirmed either account and did not immediately respond to CSO Online's request for comment. SecurityWeek says Microsoft's Agent Framework repository on GitHub was inaccessible when it wrote, and that several other Microsoft repositories, including ONNX Runtime projects, had also disappeared; it is unclear whether that is related.
SafeDep found a PyPI maintainer account, set up the same day as the attack, that could publish the package and five related projects, but its role has not been confirmed, according to SecurityWeek. Durabletask, a different Microsoft Python package, was also compromised earlier this year; no researcher has linked the two incidents, Wiz and CSO Online say.
What should developers do?
Researchers advise checking developer machines, build pipelines, lockfiles and container images for v1.26.1 and v1.26.2 and pinning to v1.26.0. Removing the package stops new runs but does not undo theft that already happened, Aikido said, according to CSO Online. Anywhere either version ran, teams should treat reachable secrets as compromised, rotate them and review Azure sign-in and activity logs, Wiz and OX Security advise.
Questions readers are asking
Which versions are affected?
v1.26.1 and v1.26.2 of the Python package on PyPI. v1.26.0 is the latest clean release.
What did the malware steal?
Secrets in environment variables and credential files, plus Azure managed identity, Azure DevOps and, in v1.26.2, GitHub Actions identity tokens, according to Wiz.
What should I do if I installed it?
Remove the bad version, pin to v1.26.0, rotate every secret the affected machine or build job could reach and review Azure sign-in and activity logs, researchers say.
Sources
- Wiz: Malicious version of Microsoft's agent-framework published to PyPI
- SecurityWeek: Microsoft Agent Framework Releases Poisoned With Credential Stealer
- CSO Online: Attackers hijack Microsoft's agent-framework package to steal Azure and CI credentials
- Socket: Microsoft's agent-framework PyPI package Compromised with Credential Stealer
- #supply-chain-attack
- #pypi
- #microsoft
- #credential-theft
- #malware
Get the day's top AI & tech stories on WhatsApp: Follow the NextFish channel
Get stories like this every morning.
Related
Cybersecurity2 min
Critical NGINX flaws can let attackers run code on web servers
F5 has patched five remote code execution bugs. Wiz says AI tools helped it find the two HTTP/2 bugs; no attacks in the wild have been reported.
Cybersecurity2 min
European Commission confirms it was hit by an AI-driven cyber campaign
Pay, leave and medical reimbursement tools were taken offline. The Commission says it has found no evidence of a data breach affecting staff as a whole.
Cybersecurity2 min
Ukraine and FBI arrest four suspects in alleged $40.5M ransomware ring
Prosecutors say the group posed as IT support, using AI-generated voice calls to trick staff into handing over access. At least 28 companies paid ransoms, they say.
Cybersecurity2 min
Palo Alto Networks to buy AI startup Applied Compute for $4.5 billion
The cybersecurity company is betting that businesses will run their own open-weight AI models and need them secured. Its CEO says the bet could outgrow its security business.