News

Wiz Found a Microsoft ESRP Certificate Behind Two Malicious Agent Framework PyPI Wheels

Wiz says agent-framework 1.26.1 and 1.26.2 on PyPI ran a credential stealer at Python start. The last clean release, 1.26.0, is still current. A Microsoft ESRP certificate appears to have signed the uploads.

A Microsoft signing pipeline, not a typosquat, put malware on the official Agent Framework package. Wiz researchers say versions 1.26.1 and 1.26.2 of agent-framework landed on PyPI on November 17 with a credential stealer that runs whenever Python starts in that environment, even if nothing imports the library.

The first wheel went up at 20:35 UTC. The second followed at 21:08 UTC. Wiz says both were gone from PyPI by about 21:30 UTC. StepSecurity, which pulled the quarantined files, timed the first quarantine at 21:06 UTC and the second upload two minutes after that, which means yanking 1.26.1 did not immediately kill the publisher's access.

The last clean release is 1.26.0, published November 12. That is still the current version on PyPI, which counted 194,722 downloads in the past month when we checked on November 19.

A .pth file is enough

Python executes .pth files in site-packages at interpreter start. Version 1.26.1 dropped agent_framework_meta.pth, which imports a module that Wiz says forks into a detached session, sets _AF_TEL=1 so child processes do not run it again, and disguises itself as runtime diagnostics. Version 1.26.2 restored that package's __init__.py to the clean 1.26.0 file and moved the hook to af_runtime_diag.pth plus af_runtime_diag.py, so a hunt for the first filenames misses it.

The payload collected environment variables whose names look like secrets, other processes' environments from /proc, and credential files (Azure CLI, npm, pip, git, Docker, Hugging Face, Azure DevOps agents, .env files). It also minted fresh tokens: Azure managed identities, Azure DevOps OIDC, and, in 1.26.2, GitHub Actions OIDC for api://AzureADTokenExchange and Azure Resource Manager. Everything went out as one compressed POST to a webhook.site URL.

Wiz later read that free-tier inbox. The URL accepted at most 100 requests and expires in seven days. Fifty requests were stored. Four came from the attacker's own machines. Twenty-nine looked like sandboxes and scanners. The remaining 17 successful victim dumps, Wiz says, were only three unique cases.

The certificate, not the package name

Wiz's November 18 update is the part that travels. The attacker's tooling reported progress to the same public webhook, and from that Wiz infers a compromised client certificate and private key for Microsoft ESRP, the internal service that signs and publishes this package. A first publish from AWS was rejected by ESRP IP filtering. A second from Microsoft-owned address space succeeded. How the certificate was taken is, Wiz says, not yet known. The tooling identified itself as Cairn, an open-source AI penetration-testing framework.

Microsoft has not published its own advisory. A spokesperson told The Register the company had made some repositories private while investigating malicious content, would review, and would take further action as needed. The statement named no repositories and did not mention ESRP.

Wiz notes that another Microsoft Python package, durabletask, was compromised earlier this year after a stolen PyPI token. It does not link the two jobs. The pattern is familiar on Cyberpresso: a poisoned LiteLLM release also hid a stealer in files Python runs at start.

Anyone who installed 1.26.1 or 1.26.2 should treat that environment as exposed, pin 1.26.0, and rotate what the host could reach, including short-lived cloud and CI tokens. Look for the two .pth names. A 200 to that webhook.site host means the dump was accepted. A 410 or 429, Wiz says, means it was probably rejected by the free-tier cap.

Some offers on this page may be paid placements or contain affiliate links.

Cyberpresso: daily cyber & AI brief

Free daily newsletter, read in 5 minutes.

Subscribe free