Poisoned PyPI Releases Turned Microsoft's Agent Framework Into a Credential Stealer

Two malicious releases of Microsoft's agent-framework package appeared on PyPI on 17 November 2026 carrying a credential stealer that ran every time Python started. The versions were pulled within the hour, but anyone who installed them should check their systems and rotate exposed credentials.

Nov 22, 2026 - 18:39
Nov 22, 2026 - 18:44
 0  5
Poisoned PyPI Releases Turned Microsoft's Agent Framework Into a Credential Stealer
A developer's hands typing Python code on a laptop on a wooden desk beside a bright window, with a cup of coffee nearby.

Poisoned PyPI Releases Turned Microsoft's Agent Framework Into a Credential Stealer

Two releases of Microsoft's official agent-framework package on PyPI were not what they seemed. On the evening of 17 November 2026, versions 1.26.1 and 1.26.2 of the package — the Python SDK developers use to build and orchestrate AI agents — were published carrying a hidden credential stealer. Anyone who installed either version in that short window may have handed cloud and CI credentials to the attackers, and the danger did not require running any of the package's own code. The photo above shows a developer working with Python code; it is an illustrative image.

Two bad releases, less than an hour on PyPI

According to Wiz Research, which investigated the incident, the first malicious version, 1.26.1, appeared on PyPI at 20:35 UTC on 17 November. A second, 1.26.2, followed at 21:08 UTC, just 33 minutes later. By about 21:30 UTC both were gone from the registry, and PyPI has since quarantined them so they can no longer be installed. The last clean release is 1.26.0, published on 12 November.

The window was brief, but the package is widely used: Wiz puts its weekly downloads at around 41,000, and The Hacker News reports roughly 190,000 downloads a month. The exposure window to check is 20:35 to roughly 21:20 UTC on 17 November. Only the agent-framework meta-package was affected — the underlying agent-framework-core package and the other sibling packages were not touched, and Endor Labs found no new releases among 22 sibling packages after 12 November.

How the stealer worked

Each malicious wheel added a small .pth file to the site-packages directory: agent_framework_meta.pth in version 1.26.1 and af_runtime_diag.pth in 1.26.2. Python executes the import lines in .pth files every time an interpreter starts, so the payload ran on any Python launch in an affected environment — including pip itself — whether or not anything ever imported Agent Framework. The file and function names were chosen to look like legitimate SDK telemetry, with user-agents such as af-runtime-diagnostics/1, and the second version even restored the package's original __init__.py file so the change was harder to spot.

Once running, the stealer went straight for the credentials that matter most in cloud and CI environments. It swept up environment variables whose names contained words such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB and OPENAI, and it also read secret-looking values from the environments of up to 300 other processes on the machine. It collected credential files — Azure CLI configuration, .npmrc, pip.conf, .netrc, .git-credentials, Docker configuration, Hugging Face tokens, Azure DevOps agent credentials, and .env and JSON files under common app directories.

More seriously, it did not only read credentials that were already on disk — it asked the platform to issue new ones. It requested Azure DevOps OIDC tokens where the pipeline variables were present, and it pulled Azure managed-identity tokens for a dozen resources, from Key Vault and Storage to Cognitive Services and Azure AI, through the instance metadata service. Version 1.26.2 went further, adding GitHub Actions OIDC token theft for workflows with id-token: write permission, which could be exchanged for Azure access where an Entra ID federated credential trusted the workflow — no stored secret needed.

Everything was packed into a single JSON document, compressed, base64-encoded and sent in one HTTPS POST to a hard-coded webhook.site address. There was no fallback channel, and failed sends were silently ignored.

How much data actually left

The exfiltration channel itself limited the damage. The attackers used a free-tier webhook.site URL, which accepts at most 100 requests and expires after seven days. Wiz confirmed the attackers' token was on the free tier and analysed the 50 requests the service had stored: four came from the attackers' own machines, 29 appeared to be linked to sandbox environments, vendor scanning and tests, and the remaining 17 represented just three unique, successful cases of victim data being exfiltrated. Three victims is a small number, but each of those requests could contain working cloud, CI and registry credentials.

How the attackers got publishing access

The most unsettling part of the incident is how the releases got onto PyPI at all. Wiz assesses that the attacker compromised a client certificate and private key for Microsoft's ESRP — the Engineering System Release Pipeline, the internal service Microsoft uses to sign and publish the package. A first publish attempt from AWS was rejected by ESRP's IP filtering; a second attempt, from Microsoft-owned IP space, succeeded. How the credentials were obtained is still unknown, and Microsoft has not published a root cause of its own.

The attacker's tooling identified itself as Cairn, an open-source AI penetration-testing framework — it staged the package in a temporary directory and sent a connectivity probe before publishing. Wiz drew no conclusion about whether the operation was autonomous and did not link it to earlier Cairn-related incidents.

What Microsoft has said

Microsoft responded on 20 November by making some of its repositories private, including microsoft/agent-framework and microsoft/onnxruntime, while it investigates. "We have made some repositories private while we investigate malicious content," a Microsoft spokesperson told The Hacker News. "Our priority is to protect customers and the broader ecosystem. We are working to review and will take further action as needed."

The incident has been recorded under advisory GHSA-764m-3ppc-5m73, and no CVE has been assigned. It is the second time this year a Microsoft Python package has been compromised on PyPI: in May 2026, malicious versions of durabletask were pushed to distribute the Mini Shai-Hulud worm. Wiz said it has not linked the two incidents.

What to do if you installed 1.26.1 or 1.26.2

If your systems or pipelines installed agent-framework 1.26.1 or 1.26.2, the advice from Wiz and other security firms is the same: isolate the affected hosts and runners, pin the package to the safe version 1.26.0 and rebuild from a clean environment. Check lockfiles, CI logs, virtual environments and container images for the two versions, and look in site-packages for agent_framework_meta.pth or af_runtime_diag.pth — any Python process started in that environment ran the payload.

Then check proxy and DNS logs for requests to the webhook.site address used for exfiltration; a 200 response means that host's data was accepted. Rotate every secret the environment could reach — environment variables, Azure CLI sessions, Azure DevOps tokens and service connections, npm, PyPI, NuGet, Docker and Hugging Face tokens, and git credentials — from a clean system. Audit Azure sign-in and activity logs for managed identities and federated credentials reachable from affected machines, and review GitHub Actions workflows that deploy to Azure, since stolen managed-identity and OIDC tokens remain valid for up to 24 hours.

The episode is a reminder that the AI developer ecosystem is now a prime target: attackers did not need to break into Microsoft's code. They needed only a valid publishing credential and an hour on the world's most trusted Python registry. For teams building AI agents, the lesson is to pin dependencies, verify what changed in every update, and treat any unexpected release — even from a vendor as large as Microsoft — as something to check before it reaches production.

Related reading

China-linked hackers exploited a VMware vCenter zero-day

Uber drivers' licence data stolen in the Fireworks AI breach

Sources

Wiz Research — Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines

The Hacker News — Attackers Compromise Microsoft's Agent Framework PyPI Package to Steal Cloud Credentials

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0