Connect with us

NEWS

Poisoned Agent Framework Wheels Minted Cloud Tokens at Startup

Poisoned Microsoft agent-framework wheels on PyPI ran a silent startup stealer on November 17 and filled a free inbox after three victim drops.

Published

on

1.26.1 and 1.26.2 of Microsoft’s agent-framework package on PyPI ran a credential stealer at every Python start on November 17, 2026. The two wheels sat on the index for 41 minutes, kept the real framework working, and posted secrets to a free webhook.site inbox.

Microsoft Agent Framework is the company’s open-source toolkit for building AI agents. The installer package sees about 192,000 downloads a month. Anyone who pulled either bad release, on a laptop, a CI runner, or a container image, has to treat that environment as exposed.

Two Releases Lasted 41 Minutes on PyPI

StepSecurity, which pulled both quarantined wheels from the PyPI file host, timed the first malicious upload at 20:35:20 UTC on November 17. PyPI quarantined 1.26.1 at 21:06:16 UTC, 31 minutes later. Version 1.26.2 went up at 21:08:39 UTC, 2 minutes 23 seconds after that quarantine, and came down at 21:16:44 UTC, eight minutes after it landed.

The last clean build, 1.26.0, had shipped on November 12 at 18:24 UTC as a wheel plus a source archive. Both poisoned releases were wheel-only, a break from every build from 1.20.0 through 1.26.0, which had shipped both files. They still pinned agent-framework-core 1.26.0, so imports kept working and nothing in the app log looked broken.

THE NOVEMBER 17 UPLOAD WINDOW

  1. November 12, 2026, 18:24 UTC: Legitimate 1.26.0 publishes as a wheel and an sdist.
  2. November 17, 20:35:20 UTC: Malicious 1.26.1 publishes as a wheel only, with no provenance attestation.
  3. November 17, 21:06:16 UTC: PyPI quarantines 1.26.1.
  4. November 17, 21:08:39 UTC: Malicious 1.26.2 publishes with renamed files and GitHub Actions token theft.
  5. November 17, 21:16:44 UTC: PyPI quarantines 1.26.2, 41 minutes after the first bad upload.

JFrog Security Research said automated bots such as Renovate were already opening upgrade pull requests in downstream repos within six minutes of 1.26.1 hitting the index. A short window still matters when installers resolve “latest” on every job.

The Hook That Fires When Python Starts

agent-framework is a thin meta-package. Microsoft’s quick-install path tells people to pip-install it, while the code they actually import lives in agent-framework-core. Hiding a stealer only inside agent_framework_meta would never run in a normal app, because that stub is not the module anyone imports.

The fix, for the attacker, was a one-line .pth file dropped at the root of site-packages. Version 1.26.1’s file holds a single instruction, import agent_framework_meta. During startup, Python’s site module scans site-packages, and any.pth line that begins with import is executed before user code, tests, or even pip itself. Installing the wheel does not run the payload. The next python, pytest, linter, language server, container entrypoint, or pip command in that environment does.

In 1.26.1 the import hits a short try/except block appended to agent_framework_meta/__init__.py that calls _telemetry._start(). That function sets an anti-loop flag, _AF_TEL=1, then forks a child, detaches it with setsid, and harvests in the background. The parent command returns at once. On Windows, where fork is missing, it falls back to a daemon thread. JFrog’s sandbox runs found no lockfile on disk, so every later Python launch without that flag collects again.

The collector reads hostname, user, working directory, and arguments, then sweeps environment variables whose names contain strings such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI, and HF_. Because KEY and TOKEN match broadly, third-party LLM keys ride along. It then reads credential files (Azure CLI caches, pip, npm, git, Docker, Hugging Face, Foundry, Azure DevOps agent stores,.env files), scrapes up to 300 live process environments from /proc, and asks Azure for fresh managed-identity tokens across 12 resource audiences, including Resource Manager, Key Vault, Storage, Graph, and Azure DevOps.

The bundle is zlib-compressed, Base64-encoded, and POSTed once to webhook.site on path d381fd80-ec62-42ad-8f5c-d1b15103c9bb with a diagnostics-style User-Agent. There is no second-stage download and no extra persistence outside site-packages. HTTPS carries the request. The encoding is not encryption.

What Version 1.26.2 Added for GitHub Actions

After 1.26.1 came off the index, the second wheel restored the clean __init__.py and moved the hook to af_runtime_diag.pth, which imports af_runtime_diag.py. Searching only for the first file names misses this release. The collector also started asking GitHub Actions for identity tokens, which is the piece aimed at jobs that deploy to Azure without a stored cloud password.

On a runner with ACTIONS_ID_TOKEN_REQUEST_URL set, 1.26.2 requested JWTs for api://AzureADTokenExchange and https://management.azure.com/. GitHub issues those tokens when a job has id-token: write. If Entra ID already trusts that workflow as a federated credential, those JWTs can be exchanged for Azure access. The script collects the responses. It does not complete the Azure exchange itself.

WHAT CHANGED BETWEEN THE TWO WHEELS

Detail 1.26.1 1.26.2
Uploaded (UTC) 20:35:20 21:08:39
Startup file agent_framework_meta.pth af_runtime_diag.pth
Stealer module agent_framework_meta/_telemetry.py af_runtime_diag.py
GitHub Actions OIDC No Yes
File harvest cap 60 80
User-Agent af-runtime-diagnostics/1 runtime-diagnostics/1

Both versions also try Azure DevOps OIDC using SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI. JFrog found that request is malformed: it posts without the required serviceConnectionId, so a real Azure DevOps endpoint rejects it with HTTP 400. The pipeline token in the environment still leaks. On Linux hosts that are not Azure VMs, 13 sequential eight-second timeouts against the instance metadata address stall the child for about 104 seconds before the POST. Thirty-three of 35 file globs are absolute Linux paths, so macOS home-directory secrets are mostly missed, though environment variables and ~/.azure JSON caches still go out.

Zip Headers Point to a Local Rebuild

JFrog researcher Shavit Satou wrote that ZIP headers show the 1.26.1 wheel was packed locally with Info-ZIP zip 3.0 at 20:26:19 UTC on November 17, nine minutes before upload, under Unix uid=1000 on a host whose clock was set to UTC+8. The WHEEL metadata still claimed Generator: flit 4.2.0, the same label Microsoft’s real builds use. That is a local repack of the clean 1.26.0 wheel, not a build from Microsoft’s Azure DevOps and ESRP release train.

Wiz researchers, looking at a different slice of the same night, said the attacker appeared to have a client certificate and private key for Microsoft ESRP, the internal service that signs and publishes this package. A first publish try from AWS was rejected by ESRP IP filtering. A later try from Microsoft-owned address space succeeded. The tooling named itself Cairn, an open-source AI penetration-testing framework, staged files at /tmp/cairn_pkg, and sent a CAIRN_ESRP_PROBE2 probe. Rami McCarthy, a Wiz researcher, later wrote that the operation used Cairn, a harness called Pi, and GLM 5.3. How those ESRP credentials were obtained is not public. The two accounts can sit together: a wheel packed on a local box, then pushed through a publish path that still accepted the caller.

Both malicious wheels used the uploader user-agent RestSharp/106.13.0.0 and carried no provenance attestation. SafeDep noted that 1.26.0 had no attestation either, so a consumer had no cryptographic way to tell Microsoft’s upload from the attacker’s. This is the second Microsoft PyPI project in six months to take rogue releases. In May, durabletask 1.4.1 through 1.4.3 went up with a stolen API token and no matching git tags. SafeDep found no shared payload or infrastructure with this incident. The same one-line.pth-plus-fork shape showed up in LiteLLM 1.107.0 in October.

Taking 1.26.1 Down Did Not Stop 1.26.2

Quarantine on PyPI stops installers from fetching that version. It does not, by itself, cut the credential that published it. The 2 minutes 23 seconds between 1.26.1 coming down and 1.26.2 going up is the proof. The second wheel also renamed every malicious file, which is the move you make when you still have the upload key and you expect hash-based blockers to be watching the first layout.

SafeDep reported on November 18 that PyPI listed a second maintainer on agent-framework named vibiret, an account that joined the same day as the attack. The account could also publish five related projects. It was not listed on agent-framework-core, which holds the framework code. PyPI does not publish who uploaded a given file, and neither PyPI nor Microsoft has released the upload log that would pin the wheels on that account.

PROJECTS VIBIRET COULD PUBLISH ON NOVEMBER 18

  • agent-framework-openai: Version 1.18.2, and it installs with agent-framework 1.26.0.
  • agent-framework-purview: Version 1.0.0b261112, also pulled in with the meta-package.
  • agent-framework-redis: Version 1.0.0b261112, also pulled in with the meta-package.
  • agent-framework-tools: Version 1.0.0b261112, also pulled in with the meta-package.
  • agent-framework-postgres: Version 1.0.0a261112, not installed with the 1.26.0 extra.

Four of those extras are accepted at any version below 2.0 when someone installs agent-framework 1.26.0. StepSecurity checked those satellite packages during its investigation and found no uploads after November 12. A GitHub Advisory Database record, GitHub advisory for agent-framework, lists the incident as malware under CWE-506, the embedded malicious code class, with no patched versions, because the poisoned wheels were pulled rather than fixed in place.

Three Victims, Then a Full Inbox

The operator pointed a hook that runs on every Python start at a free webhook.site bin. JFrog found that bin returning HTTP 429, Request limit exceeded, when researchers checked it. Early posts before the cap still went out as HTTP 200. A public UUID inbox can also be read by anyone who has the path, which is a separate leak of whatever did arrive.

McCarthy wrote that the attackers were sending their own activity to the same endpoint, and that scanners then burned the rest of the quota.

Outside of attacker traffick, only three victims had data leaked before the free-tier ran out.

Rami McCarthy, security researcher at Wiz, on X

He also credited 17 requests from scanners, vendors, and tests with eating quota. That is why a technically working stealer still produced a tiny public harvest: only three victims leaked data into a bin that filled itself. It is not a reason to skip rotation. Anyone in those three dumps, and anyone whose POST was blocked after the cap, still ran the collector against whatever that host could see, including short-lived OIDC tokens that rotating a static secret does not cancel.

Rebuild From 1.26.0 Before the Next Python Start

Do not open with a bare pip uninstall. pip is a Python entrypoint, so launching it loads site.py, processes the.pth file, and runs the collector one more time. JFrog’s cleanup sets _AF_TEL=1 first, deletes the hook files and bytecode, then uninstalls and pins the last clean 1.26.0 release. uv is a compiled Rust binary and does not execute.pth hooks during removal, so uv pip uninstall can run without that flag. Rebuild the environment from a known-clean base. Cached wheels in Artifactory-style proxies, lockfiles, Renovate PRs opened on November 17, and container images built in that window all have to be checked, because a baked-in site-packages copy runs on every container start.

IF 1.26.1 OR 1.26.2 TOUCHED A HOST

  • Isolate first: Do not start Python or pip until the hook files are gone or _AF_TEL=1 is set.
  • Hunt the files: Look for agent_framework_meta.pth and _telemetry.py, or af_runtime_diag.pth and af_runtime_diag.py, plus leftover.pyc bytecode.
  • Pin 1.26.0: Reinstall only that version, with –no-cache-dir, after the environment is rebuilt.
  • Rotate what it could reach: Cloud, LLM, and registry keys, Azure CLI refresh tokens, Docker and git credentials, npm and pip tokens, and CI secrets mapped into the job.
  • Read egress logs: Search for POSTs to the webhook UUID path with User-Agent runtime-diagnostics/1 or af-runtime-diagnostics/1, and separate blocked tries from HTTP 200 transfers.

Issued Azure and GitHub identity tokens have no static secret to rotate and can remain valid for up to 24 hours, so teams also have to recycle affected runners and review sign-in logs for those identities.

Harry is the editor of SOMALI UPDATE, an independent title he owns and runs. Ten years in journalism, from reporter to editor, have settled into a set of verification habits he applies to every story. A quote is checked against the recording or transcript it came from. A statement attributed to an organisation is confirmed on that organisation's own channels before it is repeated. A figure is traced to the dataset or filing that first published it, and a photograph is checked for when and where it was actually taken. If any of those checks fails, the claim is left out or clearly marked as unconfirmed. Those habits cover the whole site, which reports news, business, technology, science and sports along with entertainment, lifestyle, travel, auto and gaming for readers around the world. Product claims in the technology, auto and gaming pages are tested in use where Harry can get his hands on the product. Corrections are published under a public policy and noted on the article. Readers who want to question a fact can write to support@somaliupdate.com.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Trending