Poisoned Pipeline / Incidents / AS519
agent-framework 1.26.1 and 1.26.2, published 33 minutes apart through a maintainer account created the same day, planted a .pth startup hook that ran a credential stealer on every Python start in the installed environment and minted fresh GitHub Actions, Azure DevOps and Azure managed-identity tokens
PyPIGitHub ActionsAzure PipelinesDeveloper workstation
agent-framework is the umbrella package for Microsoft's Agent Framework for
Python: a thin meta-package whose only content is a module that declares
dependencies on the component packages that do the real work. Version
1.26.0 shipped normally on 12 November 2026 at 18:24 UTC, with an sdist and
a wheel, as every release in the project's history had. On 17 November a
second maintainer, vibiret, appeared on the project — an account created
that same day, and also listed as maintainer on five satellite packages in
the family (agent-framework-openai, agent-framework-redis,
agent-framework-postgres, agent-framework-purview and agent-framework-tools),
none of which has received a malicious upload so far. At 20:35 UTC version
1.26.1 was uploaded; at 21:08 version 1.26.2 was uploaded and 1.26.1 was
gone. By 21:20 both were quarantined and 1.26.0 was the latest release
again. Aikido pulled the first wheel apart while it was still live,
StepSecurity statically analysed both quarantined wheels from the PyPI file
host, and OpenSourceMalware and Wiz published their own analyses; the
project's published download volume, about 200,000 a month, is demand for
the package as a whole and does not say how many times either malicious
version was resolved.
The publishing path is the part that registry trust does not cover. Both
wheels were uploaded with the user agent RestSharp/106.13.0.0 — a .NET HTTP
client, not the project's release automation — and carry no PyPI
trusted-publishing provenance. Both are wheel-only, where every earlier
release had an sdist as well, so there is no source distribution to read.
The METADATA inside the trojanized wheels is byte-identical to the
legitimate 1.26.0 metadata apart from the version string, so the project
page, the author field and the links all looked right. What changed is
inside the archive.
In 1.26.1 the change is three pieces: agent_framework_meta.pth at the wheel
root, containing one line, "import agent_framework_meta"; a new module
agent_framework_meta/_telemetry.py; and eight lines appended to the bottom
of the package's __init__.py that import and start the module, wrapped so
that no exception can escape. In 1.26.2 the attacker moved: the appended
loader is gone and __init__.py is back to the byte-identical clean 1.26.0
content, while two new files sit at the wheel root — a 23-byte
af_runtime_diag.pth with "import af_runtime_diag" and a 7,658-byte
af_runtime_diag.py that calls _start() at the bottom. Anyone comparing the
importable package code between the two releases would find the first
payload and miss the second.
Execution follows from how Python starts. Wheels install their contents
directly into site-packages, site initialization reads every .pth file
there, and a line beginning with "import" is executed rather than treated
as a path. Neither release runs anything during the install itself. The
trigger is the next interpreter start in that environment, which in a CI
job is the next step: install the package, then run pytest, a build script
or a linter, and the payload is already resident before the tool's own code
begins. The payload sets _AF_TEL=1 to stop it running twice, forks, calls
setsid() to detach the child from the step's session and collects from
there, falling back to a daemon thread if fork is unavailable. Every
failure is swallowed, so the machine's visible behaviour does not change.
There is no second stage and no OS persistence; the persistence is the
registry entry, because the hook re-fires on every interpreter start until
the files are removed.
What the collector takes is broad by keyword rather than by name. It
records hostname, username, working directory, the first 20 command-line
arguments and a timestamp; then every environment variable whose name
contains one of about 35 substrings — TOKEN, SECRET, PASSWORD, KEY,
CONNECTION, ENDPOINT, AZURE, AWS, GITHUB, GH_, HF_, HUGGING, OPENAI,
FOUNDRY, VSS, SYSTEM, BUILD, AGENT, CI_, PIP, NPM, NUGET, COSMOS, STORAGE,
SUBSCRIPTION, TENANT, CLIENT, IDENTITY, MSI, MANAGED, ACTIONS, OIDC,
RUNNER, ARM_ — and then up to 80 files (60 in 1.26.1), each up to 256 KB,
matched by 26 glob patterns: Azure CLI token caches under ~/.azure,
pip.conf, .npmrc, .netrc, .git-credentials, Docker config.json, Hugging
Face token files, Foundry credentials, Azure Pipelines agent .credentials
files and _work paths, application .env files, and in 1.26.2 the GitHub
Actions runner's own /home/runner/work/_temp and /home/runner/.azure
directories. It also reads /proc/<pid>/environ for the first 300 running
processes and keeps entries carrying TOKEN, SECRET, PASSWORD, KEY=,
ENDPOINT_AUTH, SYSTEM_ACCESSTOKEN, IDENTITY_HEADER and, in 1.26.2,
ACTIONS_ID_TOKEN — secrets belonging to other processes on a shared runner,
not just to the one that started the payload.
The step that lifts this above a secret stealer is that it also asks for new
credentials. In 1.26.2 it presents ACTIONS_ID_TOKEN_REQUEST_TOKEN, falling
back to ACTIONS_RUNTIME_TOKEN, to the URL in ACTIONS_ID_TOKEN_REQUEST_URL and
mints GitHub Actions OIDC tokens for the audiences api://AzureADTokenExchange
and https://management.azure.com/ — which authenticate as the workload
identity on any repository with an Azure federated credential configured.
Both versions post to SYSTEM_OIDCREQUESTURI with the pipeline's
SYSTEM_ACCESSTOKEN for an Azure DevOps token exchange, api-version 7.1, and
retry with an empty body. Both query IDENTITY_ENDPOINT or MSI_ENDPOINT when
present and otherwise the Instance Metadata Service at 169.254.169.254 for a
fixed resource list — Azure Management, AI, ML, Cognitive Services, Storage,
Key Vault, Search, Graph, Container Registry, the Azure DevOps resource GUID
499b84ac-1321-427f-aa17-267ca6975798, and api://AzureADTokenExchange — and
pulls the instance metadata as well, which exposes subscription, resource
group and VM identity.
Everything collected goes out in one request: JSON, zlib-compressed at level
9, base64-encoded, POSTed with Content-Type application/octet-stream and
User-Agent runtime-diagnostics/1 (af-runtime-diagnostics/1 in 1.26.1) to
https://webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetry. The
URL is base64-encoded in the source and the query string and user agent read
as telemetry. There is no fallback channel, no retry, and the response is
read and discarded. The wheel hashes are d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110
for 1.26.1 and 3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9
for 1.26.2; the 1.26.2 payload files are af_runtime_diag.py,
54d885b7d7161c9ed96489c66364c4bfbf635929166843bba10d97d46b5a2e1f, and
af_runtime_diag.pth,
325e7e9f0ec94e41ad1a1b7a3f18a6b8b5bffece2e2b97b8d3369eb967452f93.
The remediation StepSecurity argues for is the one that follows from the
token minting: rotating the secrets that were on the host is not sufficient,
because a freshly minted JWT for api://AzureADTokenExchange stays valid for
its window and keeps being mintable until the federated identity credential
is removed. Affected organisations have to audit and revoke federated
credentials, Azure DevOps service connections and managed-identity role
assignments as well as rotate, and search egress logs for webhook.site and
the two user agents. OpenSourceMalware's framing is the same from the
registry side: PyPI quarantined the publisher on the understanding that
unauthorised publishing access was still live, and an installation of either
version is a credential compromise even if the project is later restored.
Mapped techniques
- T0134 Add user
- T0109 Publish malicious artifact
- T0206 Forge or omit build provenance
- T0244 Run a payload at every interpreter start from a site-packages hook
- T0159 Malicious artifact execution
- T0140 Harvest tokens from environment variables
- T0184 Harvesting sensitive information from files
- T0233 Redeem a build credential at internal platform services
- T0156 Exfiltration over webhooks
- T0245 Detach the payload so it outlives the job
supply-chain The release through a same-day maintainer account
The account that uploaded both wheels, vibiret, appeared on the
project on 17 November and was created that day. It is also listed
as maintainer on five satellite packages, so the publishing right
reaches beyond the one package that was used, and none of those
satellites has published anything malicious yet. How the account
was added — an owner approving it, or an owner account acting — is
not established in any of the four write-ups.
1.26.1 at 20:35 UTC and 1.26.2 at 21:08 UTC on 17 November 2026,
wheel-only where every prior release carried an sdist as well. Both
wheels carry a sha256 in the write-ups; both were quarantined and
were gone by 21:20 UTC.
Neither wheel has a PyPI trusted-publishing attestation, and both
were uploaded with the .NET client user agent RestSharp/106.13.0.0
rather than the project's release automation. The METADATA is
byte-identical to 1.26.0 apart from the version string, so the
provenance gap is the only registry-side signal that separates
these two uploads from the project's normal releases.
post-supply-chain Every Python start in the installed environment
agent_framework_meta.pth in 1.26.1 and af_runtime_diag.pth in
1.26.2 are one-line files whose "import" line site initialization
executes, so the payload fires on any interpreter start in the
environment and never needs the package to be imported. In 1.26.2
the importable package code was restored to the clean 1.26.0
content while the hook stayed at the wheel root.
The install itself runs nothing. The first python invocation
afterwards — pip, pytest, a build script, a linter, the application
— is the trigger, which in a CI job means every step after the
install step executes with the collector already resident. A job
that installs, then tests, was compromised before the tests began.
post-supply-chain The credentials on the host and the tokens it can mint
About 35 name substrings select environment variables across cloud,
registry, AI-provider and CI namespaces, and /proc/<pid>/environ is
read for up to 300 processes, so secrets held by other processes on
a shared runner are in scope. 1.26.2 added ACTIONS_ID_TOKEN to the
/proc scan's key list.
26 glob patterns, up to 80 files of 256 KB each (60 in 1.26.1):
Azure CLI token caches, pip.conf, .npmrc, .netrc, .git-credentials,
Docker config.json, Hugging Face and Foundry credentials, Azure
Pipelines agent .credentials files and _work paths, and .env files.
1.26.2 added the GitHub Actions runner's own _temp and ~/.azure
directories, which hold runner registration material rather than
job secrets.
The payload does not stop at what is on disk: it presents the
runner's own credentials to the platform services that mint
identities — GitHub Actions OIDC for api://AzureADTokenExchange and
management.azure.com, the Azure DevOps OIDC exchange via
SYSTEM_OIDCREQUESTURI, and IMDS or IDENTITY_ENDPOINT/MSI_ENDPOINT
for twelve Azure resources including Key Vault and the Azure DevOps
resource GUID. Each of those services answered a legitimate
question from a caller it considered legitimate, which is why the
resulting credential is valid even though nothing was stolen from
them.
post-supply-chain One POST and a detached child
Everything is bundled as JSON, compressed with zlib at level 9,
base64-encoded and sent in a single POST to a webhook.site UUID
path, with a "t=telemetry" query string, a diagnostics-looking user
agent and Content-Type application/octet-stream. The UUID is
base64-encoded in the source; there is no fallback channel and no
retry.
The collector forks, calls setsid() and works from the detached
child, so the exfiltration is not bounded by the step's timeout and
nothing it does reaches the job log; a daemon thread is the
fallback when fork fails, and exceptions are suppressed throughout.
The job's own exit code and output stay normal.
Framework gaps noted
- How vibiret obtained publishing rights on the project is not established. StepSecurity records the account appearing on 17 November, created that day, and OpenSourceMalware describes the uploads as coming from the Microsoft-associated publisher; neither reports an owner-side action, an invitation or a credential theft, and Microsoft had not published an incident statement in any of the four write-ups.
- What PyPI quarantined is described differently. StepSecurity and Aikido say the two releases were quarantined and 1.26.0 restored; OpenSourceMalware says the publisher was quarantined because unauthorised publishing access was believed still active. Whether the account retains access, and whether the five satellite packages are still exposed, is not stated as resolved.
- No victim count exists. The ~200,000 monthly downloads are project-level and OpenSourceMalware explicitly warns against reading them as installs of 1.26.1 or 1.26.2, so the population that resolved either version during the 45 minutes they were live is unknown.
- Whether any minted token was used is not reported. There is no telemetry from the webhook.site endpoint in public, and the payload's single POST has no acknowledgement path, so the write-ups describe capability rather than observed use.
- The payload fetches JSON from GitHub, Azure DevOps, IMDS and the metadata service, but OpenSourceMalware's static analysis found no code path that parses a response as a command or executes it, and no embedded or downloadable second stage. That is a property of these two artifacts, not of the operator.
- Wiz notes that an earlier Microsoft Python package, durabletask, was compromised in 2026 after its PyPI token was stolen, and states the two incidents are not linked. No shared infrastructure is reported.
- The 1.26.1 payload is described from Aikido's analysis and StepSecurity's file list rather than from a full capability comparison; Aikido's per-file table is the source for the rename, the user-agent change and the 60-to-80 file cap, and those three differences are the whole of the published comparison.
Sources
- https://www.stepsecurity.io/blog/microsoft-agent-framework-pypi-package-compromised
- https://www.aikido.dev/blog/two-malicious-agent-framework-releases-hit-pypi-in-33-minutes
- https://opensourcemalware.com/blog/agent-framework-pypi-compromised
- https://www.wiz.io/blog/malicious-version-of-microsofts-agent-framework-published-to-pypi