Supply Chain PyPI Credential Theft

A 28 byte file turned Microsoft agent-framework into a stealer

November 27, 2026·7 min read·CVEasy Threat Research
A stack of package blocks holds one gold startup hook that fires through every interpreter start and sends dashed lines to a single collection point

On the evening of November 17, a CI runner somewhere resolved agent-framework>=1.26, pulled the newest wheel from PyPI, ran the test suite and went green. Nothing in the logs looked unusual, because the framework worked exactly as it had the day before. In the background, a detached child process was reading the runner's environment, asking the cloud for identity tokens and posting what it found to a webhook. Aikido puts the first malicious release, 1.26.1, on PyPI at 20:35 UTC, with 1.26.2 following 33 minutes later and both gone by about 21:20 UTC. The package is the meta package for Microsoft Agent Framework and draws roughly 200,000 downloads a month, per BleepingComputer.

Ten days on, Microsoft's repository update confirms the two versions were uploaded without authorization, that the malicious code never existed in the GitHub repository, and that 1.26.0 and earlier are clean. It still does not say how the attacker got upload rights, and that gap shapes most of the cleanup advice below.

Twenty eight bytes in site-packages

The delivery trick is an old Python feature that most developers never look at. When the interpreter starts, the site module scans every site-packages directory for files ending in .pth. Normally those files list extra directories to add to the import path, but any line that begins with import is executed as code, on every interpreter start, before your program runs and whether or not anything ever imports the package that shipped the file. Editable installs and several popular tools depend on it, so it stays on by default.

The Cloud Security Alliance research note describes 1.26.1 as carrying a 28 byte file, agent_framework_meta.pth, whose only content was import agent_framework_meta. That line loaded agent_framework_meta/_telemetry.py, a name that blends in with the telemetry helpers found in most environments. For 1.26.2 the attacker restored Microsoft's clean __init__.py and moved the hook into a separately named pair, af_runtime_diag.pth and af_runtime_diag.py, so a reviewer diffing the framework's own module against the previous release would find nothing. Both wheels kept the legitimate pin on agent-framework-core[all]==1.26.0, and the CSA reports that the core package and 22 sibling packages were checked and are not affected, so every import, agent and tool call behaved normally.

Installing was enough. A host that only installed 1.26.1 or 1.26.2 and then ran any Python process at all (a linter, a test runner, an unrelated script) executed the stealer. Whether your code imported agent_framework is irrelevant to exposure.

What the hook did after the fork

Elastic Security Labs, which says it flagged the upload six minutes after it went live, describes a _start() function that checks an environment variable, _AF_TEL, so the payload runs once per process tree instead of once per interpreter, then forks a child and calls setsid() to detach it from the terminal and from the parent's lifetime. The parent returns immediately, so startup stays fast and the detached child can keep working after a short lived pytest run has exited.

The child collects environment variables that look like secrets, reads credential files from disk, and pulls the environment blocks of up to 300 other running processes, which on a shared build agent can include tokens that belong to other jobs. Reporting from OX Security and Socket lists Azure CLI credentials, Azure DevOps agent secrets, Git credential stores, Docker and npm configuration and .env files among the targets. Both versions also request Azure managed identity tokens, and 1.26.2 added theft of GitHub Actions OIDC tokens, which is the main functional difference between the two releases. Aikido reports that results left as zlib compressed, base64 encoded JSON to a webhook.site address, sent with an af-runtime-diagnostics user agent.

The token requests matter more than the file reads. A stolen .env file holds whatever secrets were in it, while a managed identity or OIDC token is minted for the workload and carries whatever cloud role that workload was granted, so the damage tracks the permissions of the runner, not the contents of its disk. StepSecurity notes its findings come from static analysis and that it has not confirmed a token was successfully issued to the attacker.

Thirty three minutes and a quarantine that did not lock the door

The timeline carries the least comfortable fact in this incident. PyPI quarantined 1.26.1, and the attacker uploaded 1.26.2 anyway, which StepSecurity reads as proof that quarantine did not revoke the publishing credential, while noting it says nothing about whether that access still works today. StepSecurity also points out that 1.26.1 went up as a bare wheel with no provenance attestation. One theory, raised in GitHub issue 10411, is a legacy upload token left over from a retired local publishing workflow, and Microsoft has confirmed no explanation at all. Endor Labs argues that trusted publishing with attestations would not have stopped an upload made with a stolen token.

Why a dependency scanner had nothing to flag

There is no CVE for this, and there will not be one, because nothing in Microsoft's code is vulnerable. A CVSS first queue never receives a row. A software composition scanner that matches lockfile versions against advisory databases only catches it after an advisory is published for the malicious versions, and by then the runner has already executed the payload, since execution happens on the first interpreter start after install. The lockfile also lies by omission on hosts where it was regenerated: a range pin like >=1.26 resolved to a malicious version for under an hour, then back to 1.26.0 after removal, so today's lockfile can look clean on a machine that ran the stealer.

How TRIS ranks a host that installed 1.26.2

TRIS, the Threat and Risk Intelligence Scoring engine inside CVEasy AI, scores this as a malicious package finding, and three layers decide where each affected host lands.

Exploitation evidence. The malicious code shipped, ran on install and was confirmed by Microsoft and several independent researchers, which TRIS treats as confirmed delivery. Successful token issuance to the attacker is unproven, so TRIS does not claim confirmed credential use and keeps that distinction visible in the finding.

Install window evidence. TRIS checks whether a host actually resolved 1.26.1 or 1.26.2 between 20:35 and about 21:20 UTC on November 17, using package caches, build logs and the .pth files on disk, rather than trusting today's lockfile.

Identity reach. TRIS weighs what the host could mint. A GitHub Actions runner or Azure DevOps agent with a managed identity that can write to production lands in the top ACT band, and a developer laptop with only a personal Git token ranks well below it. A sandboxed container with no cloud identity and no egress to webhook.site scores far lower again, and stays tracked until its credentials are rotated.

Clean up, rotate, then hunt for other startup hooks

  • Pin agent-framework==1.26.0 with hash checking and block 1.26.1 and 1.26.2 in your package proxy, as the CSA note and OX recommend. Replace range pins in CI requirements files.
  • Search every site-packages directory on build agents, images and laptops for agent_framework_meta.pth, agent_framework_meta/_telemetry.py, af_runtime_diag.pth and af_runtime_diag.py. Inspect with python -S so the hooks do not run while you look.
  • In proxy and DNS logs for November 17 onward, look for requests to webhook.site and for the af-runtime-diagnostics user agent. In process telemetry, look for detached Python children with _AF_TEL set in their environment.
  • Rebuild affected runners and images from a clean base instead of uninstalling the package, because removal stops future runs and does nothing about data already sent.
  • While you are in site-packages, list every .pth file that contains an import line and confirm each one belongs to a package you expect. This is the persistence point the next stealer will use too.
Rotation is not optional. Aikido and OX both advise treating every secret reachable from an affected host as stolen. Revoke and reissue Azure service principal secrets, Azure DevOps personal access tokens and service connections, GitHub tokens, registry credentials and anything in local .env files. StepSecurity warns that tokens minted through federated credentials keep working after a secret is rotated, so remove and recreate the federated credential, then review cloud sign in logs from November 17 for the identities involved.

How CVEasy AI surfaces this

CVEasy AI, the number one local-first CTEM platform, ingests researcher reports, registry removals and indicators for incidents like this one, then runs them through TRIS against the inventory collected on your own hardware, including the Python environments on build agents and the cloud identities those agents carry. It answers the questions that decide this week: which hosts resolved 1.26.1 or 1.26.2 inside the window, which of them could mint a managed identity or OIDC token, which credentials still need rotating, and which other .pth startup hooks exist across your fleet. Your inventory and the answers stay on your hardware.

Sources: Microsoft Agent Framework repository update, GitHub issue 10411, Elastic Security Labs, Cloud Security Alliance research note, Aikido, StepSecurity, OX Security, Socket, Endor Labs, BleepingComputer

A package you installed once, scored by what its host can mint

CVEasy AI maps the Python environments on your build agents and the cloud identities they carry, and scores the exposure on your own hardware.

Related Reading