Back to Newsroom
Threat Intel

Microsoft Agent Framework PyPI releases 1.26.1 and 1.26.2 shipped a credential stealer

Two malicious agent-framework versions hit PyPI on 17 November and stole Azure, GitHub Actions and CI secrets on every Python start. Pin 1.26.0 and rotate credentials.

Microsoft Agent Framework PyPI releases 1.26.1 and 1.26.2 shipped a credential stealer

Two releases of agent-framework, the Python package for Microsoft Agent Framework, carried a credential stealer when they were published to PyPI on 17 November 2026. Versions 1.26.1 and 1.26.2 have been pulled from the index. Version 1.26.0, released on 12 November, is the last clean build, and anything older is not affected.

What happened

Version 1.26.1 appeared at 20:35 UTC as a wheel only, with no source archive alongside it. Version 1.26.2 followed at 21:08 UTC. Both went out under the real agent-framework project, not a lookalike name, so pip install agent-framework or an unpinned dependency would have pulled them in during that window. PyPI's index now lists 1.26.0 as the latest version.

How the attacker got publishing rights is not confirmed. Whoever uploaded 1.26.1 still had access half an hour later, when 1.26.2 went up. We had not found an official Microsoft advisory when this was written. The incident has no CVE; it is tracked as a malicious package in the open source vulnerability database as MAL-2026-20101.

The package sees roughly 190,000 downloads a month. That figure describes normal use of the project. It is not a count of victims, and nobody has published one.

Who is affected

Anyone who installed agent-framework 1.26.1 or 1.26.2 on a laptop, server, container image or CI runner on or after 17 November. Build systems are the main worry, because they tend to hold the most valuable secrets and they install fresh packages all the time.

Projects pinned to 1.26.0 or earlier, or installed from a lockfile created before 20:35 UTC on 17 November, did not get the malicious code.

How it works

Each malicious wheel drops a .pth file into site-packages. Python reads these files every time the interpreter starts, and a line that begins with import gets executed (Python's documentation on the site module explains the mechanism). So the stealer ran whenever any Python process started in that environment, even one that never imported Agent Framework.

  • 1.26.1 used agent_framework_meta.pth and a module called agent_framework_meta/_telemetry.py.
  • 1.26.2 renamed them to af_runtime_diag.pth and af_runtime_diag.py, and left the package's own __init__.py identical to 1.26.0. A check that only looks for the first set of file names will miss the second.

The code forks into the background and hides its own errors. It collects environment variables whose names contain words such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB or OPENAI, and it reads the environment of other running processes. It also takes credential files: Azure CLI data in ~/.azure, .npmrc, .netrc, .git-credentials, Docker's config.json, Hugging Face tokens, Azure DevOps agent credentials and .env files.

It does not stop at secrets already on disk. It asks the Azure instance metadata service for fresh managed identity tokens and requests an Azure DevOps OIDC token. Version 1.26.2 also requests GitHub Actions OIDC tokens in workflows allowed to issue them. If a cloud tenant trusts that workflow, such a token can be swapped for cloud access with whatever permissions the identity holds.

Everything is compressed with zlib, base64-encoded and sent by HTTPS POST to webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb. The User-Agent is af-runtime-diagnostics/1 in 1.26.1 and runtime-diagnostics/1 in 1.26.2.

What to do now

  1. Look for the versions. Search lockfiles, requirements files, CI logs, container images and package caches for agent-framework 1.26.1 or 1.26.2. On hosts, look in site-packages for agent_framework_meta.pth or af_runtime_diag.pth. The wheel SHA-256 hashes are listed in the MAL-2026-20101 record.
  2. Don't start Python on an affected machine to investigate. Every interpreter start runs the stealer again. Isolate the host or runner, keep the logs, and rebuild from a known-good image.
  3. Pin to 1.26.0 with hash checking (pip install --require-hashes), and block 1.26.1 and 1.26.2 in any internal package mirror. Removal from PyPI does not remove copies that are already installed or cached.
  4. Rotate secrets from a clean system. That means Azure service principals and managed identity assignments, Azure DevOps PATs and agent registrations, GitHub tokens and federated credentials, npm, PyPI, Docker and Hugging Face tokens, model provider API keys and anything in .env files the host could read.
  5. Check the logs. Search proxy and DNS logs for the webhook.site path above and both User-Agents. Review Azure sign-in and activity logs for unexpected managed identity or service connection use from 17 November onward. For GitHub Actions jobs that installed 1.26.2 with id-token: write, review the federated trust settings and sign-ins of the linked application.

A rule worth keeping after this: alert when a dependency update adds a new .pth file, or when a project suddenly ships a wheel without its usual source archive. Both showed up here before anyone ran the code. Our AI-assisted code review checks dependency changes and lockfiles for this kind of signal, along with secrets left in repositories, so a poisoned release is easier to catch before it lands on a build server.

SHARE