AI Today

🔒 Microsoft's Agent Framework package on PyPI compromised: two versions stole credentials

· 3 min

Microsoft-Logo vor roten Lichtstreifen / Microsoft logo over red light streaks

In brief


🛡️ Attackers published two malicious versions of Microsoft's open-source Python package Agent Framework (agent-framework) on PyPI on November 17, 2026; the package has about 200,000 monthly downloads. Versions 1.26.1 and 1.26.2 contained a credential stealer that, BleepingComputer reports, ran automatically during normal Python startup in affected environments, even if the package was never imported. It harvested secrets from environment variables, config files and other running processes, for example for Azure, AWS, GitHub, Docker, Hugging Face and OpenAI, and sent them to an attacker-controlled webhook. Version 1.26.2 came about 2.5 minutes after 1.26.1, and PyPI quarantined both. Version 1.26.0 is clean. How the attackers could publish under Microsoft's project name is unclear; Microsoft had not responded at publication.


📦 The package is Microsoft's open-source toolkit for building and coordinating AI agents in Python. Both malicious versions kept the legitimate agent-framework-core 1.26.0 dependency, so the framework still worked normally while the malware ran in the background.

🔑 Version 1.26.1 launched the stealer through a .pth file named agent_framework_meta.pth, which Python processes at startup; the code sat in agent_framework_meta/_telemetry.py. It harvested secrets from environment variables, local config files and other running processes where permissions allowed, targeting credentials for Azure, AWS, GitHub, Docker, Hugging Face, OpenAI and other services. It also tried to obtain Azure managed identity access tokens and Azure DevOps OIDC tokens, which could expose additional cloud resources. Version 1.26.2 restored the original package initializer and moved the malicious code into af_runtime_diag.pth and af_runtime_diag.py. It added requests for GitHub Actions OIDC tokens and searched GitHub runner directories. Both versions sent the collected data to the same attacker-controlled webhook.site endpoint.

⏳ Timeline: the first malicious release was published on November 17. About 2.5 minutes later the attacker published 1.26.2, and about 8 minutes after that PyPI quarantined it; the first release had already been quarantined. That the second release appeared at all shows the attacker still had publishing access after the first quarantine. How the attacker gained the ability to publish under Microsoft's official PyPI project is unclear. Microsoft had not responded to BleepingComputer by the time of the November 18 report. The technical analysis is credited to Socket, StepSecurity and OX Security.

🧯 The report's recommended steps: isolate any environment that installed 1.26.1 or 1.26.2; avoid running Python or pip there until it is secured; rebuild from a known-clean environment using version 1.26.0; rotate any credentials that were reachable; and search egress logs for the webhook path, distinguishing blocked requests from completed transfers to gauge the extent of exposure.

Sources

Open in the interactive reader →

This post was selected, researched, written and rated by AI. The AI can be wrong: check the sources. Imprint, privacy policy and terms of service