Events Securing Finance in the Age of AI · Secure.com X ZIG Finance · London, 12 Nov Register now

Microsoft Agent Framework PyPI Attack: Two Poisoned Releases Ran a Credential Stealer on Every Python Start

Microsoft Agent Framework PyPI attack: two poisoned releases ran a stealer on every Python start, grabbing Azure and GitHub tokens.

Microsoft Agent Framework PyPI attack: versions 1.26.1 and 1.26.2 malicious, 1.26.0 last safe release

Who should care: Teams building AI agents in Python, and anyone whose CI pipelines were exposed to the Microsoft Agent Framework PyPI attack on November 17.
What could go wrong: One install could hand over Azure tokens, GitHub OIDC tokens, and every secret in your build environment.
Do this: Check lockfiles for versions 1.26.1 or 1.26.2 today.
Worth remembering: Pulling a package from PyPI does not pull it from your machines.

The Microsoft Agent Framework PyPI attack lasted about 55 minutes. On November 17, the official Python package for Microsoft Agent Framework carried a credential stealer. It shipped from Microsoft’s own publisher account. No typo, no lookalike name. Nothing about it looked fake.

What Happened in the Microsoft Agent Framework PyPI attack?

Version 1.26.1 landed on PyPI at 20:35 UTC. Once it was pulled, version 1.26.2 followed at about 21:08 UTC. Both were gone by 21:30 UTC and now sit in quarantine.

Researchers at Wiz found no matching release tag in Microsoft’s GitHub repository and no malicious code on its main branch. The first upload shipped as a lone wheel with no source archive, suggesting a push outside the normal release process. How the attacker got publishing access is still unconfirmed.

A Stealer That Didn’t Need an Invite

Both releases dropped a .pth file into site-packages. Python reads those at startup, so the stealer fired every time the interpreter launched, even in apps that never imported the framework. LiteLLM got hit with the same trick in March.

It swept environment variables named like TOKEN, SECRET, KEY, or AZURE from its own process and up to 300 others. Then it grabbed up to 80 credential files: Azure CLI state, .npmrc, Git credentials, Docker configs, Hugging Face tokens, .env files.

Then it went further, minting fresh Azure managed identity tokens for 12 resources (Key Vault and Microsoft Graph among them) plus Azure DevOps OIDC tokens. Version 1.26.2 also requested GitHub Actions OIDC tokens.

Everything left in one HTTPS POST to a hardcoded webhook.site URL. Compressed, encoded, not encrypted.

How the agent-framework stealer ran: install, .pth file drop, credential harvest and exfiltration, with the November 17 timeline

What’s the Impact?

The Microsoft Agent Framework PyPI attack hit a package that pulls roughly 41,000 downloads a week, and loose pins like >=1.26 grabbed the bad builds automatically. The endpoint logged at most 50 requests, which is not a victim count. Images built in the window still carry the hook. It’s Microsoft’s second poisoned PyPI package this year.

How to Avoid the Microsoft Agent Framework PyPI Attack

If any system installed a bad build, work through these steps in order:

  • Hunt first: Search lockfiles, build logs, virtual environments, and image layers for both versions, and search site packages for the files in the IOC list.
  • Rebuild, don’t upgrade: Use a clean image pinned to 1.26.0. A newer version won’t remove an installed hook.
  • Rotate from a clean machine: Cloud keys, Azure DevOps tokens and service connections, registry, Git and AI service keys.
  • Audit Azure: Review Entra ID sign-ins and managed identity activity from 20:35 UTC on November 17.
  • Tighten pipelines: Pin exact versions with hashes, add a cooldown for new releases, and drop id-token: write from jobs that only install packages.

Indicators of Compromise for the Microsoft Agent Framework PyPI Attack

These indicators come from OpenSourceMalware’s IOC analysis and Wiz research on this compromise. Match the full webhook path, not the bare domain.

Indicators of compromise for the malicious agent-framework 1.26.1 and 1.26.2 PyPI releases

The Attack Lasted 55 Minutes. The Cleanup Shouldn’t Take Weeks.

Attacks like the Microsoft Agent Framework PyPI attack end before most teams notice. Cleanup is pure grunt work, and Secure.com runs it as a service, so you get results instead of another tool to babysit.

  • Managed SecOps: Experts watch around the clock, catch odd outbound traffic from build hosts, and lead the response.
  • Managed Exposure Management: We find every system running a bad version, map which identities it could reach, and verify each fix.
  • vCISO: A senior security leader sets dependency policy (pinning, cooldowns, approval gates) and reports exposure to the board.
  • Your rules, our work: Your team sets the guardrails. We attack, harden, and prove it. Repeat.

Frequently Asked Questions

What was the Microsoft Agent Framework PyPI attack?
The Microsoft Agent Framework PyPI attack was a supply chain compromise on November 17, 2026. Attackers published two malicious versions of the official agent-framework package, 1.26.1 and 1.26.2, from Microsoft’s own publisher account. Both carried a credential stealer and were gone from PyPI within about 55 minutes.
Which agent-framework versions are malicious?
Versions 1.26.1 and 1.26.2 are malicious. Version 1.26.0 is the last safe release. Both bad versions are now quarantined on PyPI, but any environment or container image that installed them still carries the stealer.
Do you need to import the package to be affected?
No. Both releases dropped a .pth file into site-packages. Python reads .pth files at startup, so the stealer ran every time the interpreter launched, even in apps that never imported the framework.
Is upgrading to a newer version enough?
No. A newer version will not remove the installed .pth hook. Rebuild from a clean image pinned to 1.26.0, then rotate every secret the affected system could reach, working from a clean machine.
What data did the stealer take?
It took environment variables named TOKEN, SECRET, KEY, or AZURE; up to 80 credential files such as Azure CLI state, .npmrc, Git credentials, and .env files; and fresh Azure managed identity and Azure DevOps OIDC tokens. Version 1.26.2 also requested GitHub Actions OIDC tokens.