UK — The Register
Microsoft's official Python agent framework hijacked to distribute malware
Security1 min read
Hackers took over a Microsoft package for building AI agents on PyPI, the main Python package site. The poisoned version installs software that steals passwords and login keys from developers.
What happened
Microsoft's official agent-framework package for Python was hijacked. Versions 1.26.1 and 1.26.2 were found to carry info-stealing malware. Security firms think an attacker got into an admin account on Microsoft's GitHub organization. Version 1.26.1 was reverted to a safe version, but the attacker then uploaded 1.26.2 using Microsoft's official PyPI publisher account.
Key facts
- The package gets nearly 200,000 downloads a month.
- Affected versions are 1.26.1 and 1.26.2.
- The safe version is 1.26.0.
- The malware sends stolen data to a webhook.site address built into the code.
- The GitHub repo for agent-framework was offline when the article was written.
How the attack works
The bad package still installs the real version 1.26.0, so it looks normal. In the background, it collects secrets such as cloud login keys and credential files. It then requests new identity tokens from GitHub Actions, Azure DevOps, and Azure, and sends everything to an outside server. The malware does not need to be imported. It runs as soon as Python starts with the package installed. It also does not stay on the computer, and it only runs while the bad version is in the site-packages folder.
Why it matters
Anyone who installed either bad version should check their account security right away. The attack is especially risky in cloud build systems, where even short-lived tokens can be used quickly once stolen. The attack also shows how a single compromised admin account can put trusted software at risk.
What to watch
- Whether Microsoft confirms the cause and how the admin account was breached.
- Whether the ONNX Runtime repo going offline is linked to the attack.
- Whether Microsoft locks down its PyPI publisher credentials.
- Whether developers who used the bad versions find stolen secrets being misused.
Glossary
- PyPI
- The main public website where Python developers download and share software packages.
- GitHub
- A website where developers store, share, and work on code together.