Follow
Subscribe via Email!

Enter your email address to subscribe to this platform and receive notifications of new posts by email.

Microsoft Agent Framework PyPI Package Hijacked to Push Malware

Attackers compromised Microsoft’s Agent Framework package on PyPI, publishing two rogue versions that stole cloud tokens and build secrets before removal.
A digital constellation representing the Python programming logo glowing over a blue geometric background.

Attackers compromised the official Microsoft Agent Framework package on PyPI on November 17, 2026, pushing two poisoned versions that secretly stole cloud tokens and developer credentials [2]. Microsoft built the open-source toolkit to help programmers coordinate multi-agent AI assistants, a role that brought the tool nearly 200,000 monthly downloads [1]. Security firms spotted the rogue code quickly, but automated CI runners pulled the files before PyPI staff quarantined the uploads [3].

Two Poisoned Versions Uploaded to PyPI

The first malicious release, version 1.26.1, hit PyPI at 20:35 UTC and stayed online for 31 minutes before registry admins removed it [3]. The intruder kept the clean agent-framework-core 1.26.0 package as a dependency. Legitimate agent workflows ran without errors on host machines while hidden routines collected secrets quietly in the background [2].

A second rogue upload followed almost right away. Just 2.5 minutes after the first quarantine, and 33 minutes after the breach began, the attacker published version 1.26.2 under Microsoft’s project account [2]. PyPI staff pulled that second release down after roughly eight minutes [1]. Security teams at Aikido, Socket, StepSecurity, and OX Security tracked both uploads as they reached the public registry [4]. The attacker still held publishing rights after PyPI took down the first release, pointing to a persistent compromise of the release pipeline rather than an isolated error. Endor Labs discovered that the attacker uploaded both versions only as built wheel files, omitting the Python source code archives that usually accompany standard Microsoft releases [3]. That choice helped the rogue setup files slip past basic package checks [4].

Data from PyPIStats shows that the project averages 6,900 downloads a day, or about 287 downloads an hour. TechRadar reporter Sead Fadilpašić noted that coders and cloud systems downloaded the tainted packages roughly 150 times during the brief exposure window before admins acted [1]. Many of those pulls took place inside automated Azure pipelines [3].

Exterior view of Microsoft building signage
Microsoft’s open-source package on PyPI was hijacked to distribute an infostealer. (Credit: BleepingComputer)

Startup Hooks and Webhook Theft Path

The malicious wheels did not wait for an explicit package import in Python scripts. Instead, each setup dropped a rogue .pth file into the site-packages folder of the local Python runtime. Python executes all import lines inside path files whenever the interpreter starts, which caused the stealer to run during ordinary CLI commands and pip package installs [4].

In version 1.26.1, the dropped file was named agent_framework_meta.pth, which imported a hidden module located at agent_framework_meta/_telemetry.py to begin siphoning secrets [1]. When the author uploaded version 1.26.2, they shifted the payload to avoid simple pattern detectors, placing the code inside af_runtime_diag.pth and af_runtime_diag.py [3]. The stealer bundled all collected tokens into a single structured JSON document, compressed the text with zlib, encoded it with Base64, and dispatched the data using an HTTPS POST call to a hardcoded endpoint at webhook.site [4]. Analysts at Google-owned Wiz confirmed that the destination URL was identical across both versions [1]. OX Security said that the outbound requests carried a user agent reading “af-runtime-diagnostics” to mimic normal diagnostic traffic [3].

Engineers expressed surprise because unimported packages rarely trigger automated execution on host machines. Because the payload ran early during process startup, any script running on the machine risked leaking data before defensive tools could react [4]. Intruders have repeatedly zeroed in on developer accounts, previously setting up fake AI events to steal corporate accounts from cloud engineers. In this instance, the intruder turned Python itself into an automated exfiltration engine [2].

Attack overview diagram for the malicious Microsoft Agent Framework packages
An attack overview diagram documented by Ox Security. (Credit: Ox Security via BleepingComputer)

Microsoft Agent Framework Secrets Exposed

Once running on a host, the malware searched for authentication data in environment keys, file trees, and active system tasks. The script scanned environment variables for substrings like TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, and OPENAI, grabbing values stored in process memory. In active CI build pipelines, these keys often hold broad administrator rights to remote cloud services [3].

According to researchers at OX Security, the payload also read up to 60 different credential files, including configurations for Git, Docker, npm, and pip. It searched for local .env files and grabbed tokens tied to Hugging Face accounts. Where system permissions allowed, it combed through memory to extract secrets from up to 300 other running processes [3]. This feature meant that an affected developer laptop or build runner could leak database passwords, private encryption keys, and third-party API tokens handled by separate software tools [2]. Intruders can use those stolen keys to move deeper into private GitHub repositories and Azure tenants long after the initial infection [3].

Why did attackers focus on this project? With 192,534 monthly downloads, Microsoft Agent Framework sits directly in automated workflows that test and deploy emerging artificial intelligence systems. In build setups, access tokens often carry broad write permissions. Endor Labs pointed out that while developer laptops were in scope, the authors tuned the payload specifically for CI runners and cloud workloads [3].

List of data points collected from breached developer systems
Data collected from breached systems included cloud credentials and build tokens. (Credit: Ox Security via BleepingComputer)

Cloud Tokens and Build Runner Risks

Beyond harvesting static passwords saved on local disks, the malware actively requested fresh identity tokens directly from host platforms to expand its access across connected services. SafeDep observed that the code took advantage of environment variables inside Azure DevOps pipelines, using SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI to request federated tokens for api://AzureADTokenExchange [4]. The attacker expanded these tools in version 1.26.2 to harvest GitHub Actions tokens [1].

When running inside Azure virtual machines, the stealer interrogated the Azure Instance Metadata Service at the link-local address 169.254.169[.]254 [4]. The script queried the local endpoint for virtual machine metadata, retaining up to 8,000 characters of the server response, and requested managed identity access tokens for services including Azure Resource Manager, Key Vault, Storage, Cognitive Services, Microsoft Graph, and Azure AI Foundry [3]. On App Service and Azure Functions environments, it targeted IDENTITY_ENDPOINT and MSI_ENDPOINT variables to secure equivalent cloud privileges [4]. In version 1.26.2, the code also searched runner working directories to uncover temporary job tokens left behind by active development workflows [1].

This aggressive token harvesting exposed connected cloud infrastructure to potential takeovers. Security teams have faced growing risks around autonomous software, leading engineers to study methods for securing agentic AI insiders in cloud workspaces. Protecting Microsoft Agent Framework deployments against supply chain attacks has become a top priority for cloud architects. CSO Online reporter Gyana Swain noted this was the second time in 2026 that an official Microsoft Python package suffered a breach [3]. In May 2026, researchers spotted three poisoned versions of the durabletask library that spread the Mini Shai-Hulud worm for TeamPCP, though analysts found no evidence linking the two operations [4].

Microsoft Agent Framework PyPI Package Hijacked to Push Malware — Theregister image
(Credit: Theregister)

Protecting Microsoft Agent Framework Deployments

Security researchers stressed that simply removing the Microsoft Agent Framework package or rolling back to an older version can’t undo the damage. Aikido Security warned that while uninstalling the package stops future executions on local machines, it can’t retrieve credentials or authentication tokens that were already exfiltrated to the attacker webhook [3]. Any system that ran either tainted release between 20:35 and roughly 21:20 UTC on November 17 must be treated as compromised [4].

To recover securely, administrators should isolate affected workstations and CI runners immediately, avoiding further execution of Python or pip until cleanup finishes [2]. Teams should search file systems for leftover artifacts, specifically checking for agent_framework_meta.pth and af_runtime_diag.pth in package directories [4]. Bill Toulas of BleepingComputer reported that StepSecurity advised engineers to inspect firewall and DNS egress logs for outgoing calls to the webhook URL to verify whether exfiltration completed. If network records confirm an outbound transfer, defenders must rotate every credential accessible from that host [2]. Security teams should also review Azure sign-in logs for unexpected use of managed identities or federated credentials [3].

Organizations should rebuild compromised developer systems and container images from scratch rather than attempting piecemeal repairs. Teams should pin dependencies to safe version 1.26.0 with strict hash checks [3]. Microsoft has not commented publicly on how attackers breached the project account or hijacked the wheel build process, leaving security teams to treat package registry access as a critical attack surface until platform maintainers provide technical details [1].

Sources
  1. ONLINE NEWS Fadilpašić, S. (2026, November 19). Microsoft’s official Agent Framework Python package on PyPI hijacked to push login-stealing malware. TechRadar. [Article Link]
  2. ONLINE NEWS Toulas, B. (2026, November 18). Microsoft’s Agent Framework PyPI package compromised to steal credentials. BleepingComputer. [Article Link]
  3. ONLINE NEWS Swain, G. (2026, November 18). Attackers hijack Microsoft’s agent-framework package to steal Azure and CI credentials. CSO Online. [Article Link]
  4. ONLINE NEWS The Hacker News. (2026, November 18). Attackers Compromise Microsoft’s Agent Framework PyPI Package to Steal Cloud Credentials. The Hacker News. [Article Link]
  5. ONLINE NEWS Vigliarolo, B. (2026, November 18). Microsoft’s official Python agent framework hijacked to distribute malware. The Register. [Article Link]
Leave a Comment

Related Posts
Total
0
Share