Skip to content

Cybercrime

Attackers publish malicious versions of Microsoft’s Agent Framework on PyPI

Security researchers said versions 1.26.1 and 1.26.2 ran on every Python start and sent stolen credentials to an attacker-controlled webhook.

https://breach-signal.com/cybercrime/malicious-microsoft-agent-framework-pypi-versions-steal-credentials/

Share

Key facts

  • Attackers compromised Microsoft's official Agent Framework package on PyPI and released two malicious versions meant to steal cloud credentials and other sensitive data from developer systems.
  • The stealer ran on every Python start in affected environments, regardless of whether any code imported the package.
  • The first malicious version gathered secrets from environment variables, configuration files on disk, and accessible running processes, with targets including Azure, AWS, GitHub, Docker, Hugging Face, and OpenAI.
  • The second release requested GitHub Actions OIDC tokens and searched GitHub runner directories.

Attackers turned Microsoft’s official Agent Framework package on PyPI into a credential stealer on Nov. 17, 2026. Malicious versions 1.26.1 and 1.26.2 stole cloud credentials and other sensitive data from developers’ systems.

BleepingComputer said the second version appeared roughly 2.5 minutes after PyPI quarantined the first, while Aikido Security and Wiz placed the uploads 33 minutes apart. PyPI quarantined the first malicious release, and the attacker published the second version afterward; the second release was also quarantined.

The malware stayed hard to notice because both malicious versions listed agent-framework-core 1.26.0 as a dependency, so the framework kept working normally while malicious code ran in the background. Socket and StepSecurity said version 1.26.1 launched the credential stealer through agent_framework_meta.pth together with agent_framework_meta/_telemetry.py whenever Python started. The code ran on every Python start in affected environments, even when nothing imported the package. Version 1.26.2 restored the original initializer and relocated the malicious code to af_runtime_diag.pth and af_runtime_diag.py.

OX Security said the stealer pulled data from as many as 60 credential files, including settings for Azure CLI, credentials for Git and Docker, configuration for npm and pip, tokens for Hugging Face, Azure DevOps build agent credentials, and .env files used by applications. OX Security said the stealer examined as many as 300 running processes, pulling secret-looking values from /proc/*/environ files. OX Security said the code, running inside Azure DevOps pipelines, requested an identity token for Azure DevOps and exchanged it for Azure access using SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI. OX Security put it plainly: “The package is a credential stealer.”

Version 1.26.2 requested GitHub Actions OIDC tokens (OIDC is an identity-token standard) and searched GitHub runner directories. Wiz said version 1.26.2 broadened collection to GitHub-hosted runner paths such as /home/runner/work/_temp/* and /home/runner/.azure/, and lifted the file limit from 60 to 80. The code packed the stolen information into one JSON document, compressed it with zlib, encoded it with Base64, and sent it through a single HTTPS POST to the hardcoded webhook.site address.

Both versions sent stolen data to the attacker-controlled webhook https://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb. Wiz said webhook.site provides a public request-inspection service where a free-tier URL accepts no more than 100 requests before it expires after seven days; the attackers’ free-tier token captured up to 50 requests. Wiz looked at the 50 stored requests and found that 17 represented just three unique successful exfiltrations; four originated from the attacker’s machines, while 29 stemmed from sandbox environments, vendor scanning, and tests. Wiz added this analysis to its report on Nov. 18, 2026.

The code also asked for managed identity tokens aimed at Azure services such as Resource Manager, Microsoft Graph, Key Vault, Storage, Cognitive Services, AI Foundry, and Azure DevOps. Wiz said a 200 response from webhook.site means the data was accepted, while 410 or 429 means it was rejected. BleepingComputer and Wiz say investigators should gauge compromise scope by searching egress logs for the webhook URL path and separating blocked requests from successful transfers.

It remains unknown how the attacker obtained publishing rights for Microsoft’s official PyPI project. Wiz said the intruder appears to have stolen an ESRP client certificate and private key from Microsoft; ESRP handles package signing and publishing inside the company. Wiz said an initial publishing attempt from AWS failed because of ESRP IP filtering, while a later attempt from Microsoft-owned IP space succeeded.

Wiz said the attacker’s tooling identified itself as Cairn, placed the package under /tmp/cairn_pkg, and sent a CAIRN_ESRP_PROBE2 probe to check connectivity; Wiz described Cairn as an open-source penetration-testing framework for AI. Wiz said the intruder first executed the stealer on a personal machine, capturing what looks like an AI coding agent configuration built on the open-source Pi harness with a GLM-family model called pi_glm53, routed through a local proxy.

According to Endor Labs, both malicious versions arrived as wheel files only (pre-built installable packages), without the source distribution (the release’s source code) that came with the clean release. Wiz believes someone built the release outside the normal procedure and uploaded it directly, with no repository tag corresponding to it. Socket, Step Security, OX Security, Aikido Security, Endor Labs, SafeDep, Chainguard, and Wiz also documented the malicious releases.

Microsoft has not publicly explained the breach. In GitHub issue #10411, a Microsoft member only commented, “We have taken it down. We are investigating.” Wiz said the two incidents are not linked to the earlier durabletask compromise.

In May 2026, researchers at Endor Labs found three trojanized versions of durabletask, the Python SDK Microsoft uses for Azure Durable Functions. According to The Hacker News, TeamPCP pushed three malicious versions of durabletask to spread the Mini Shai-Hulud worm. No researcher has linked the two attacks.

Supanet said developers rarely inspect every line when installing from a trusted PyPI publisher, and attackers know that. Attacks on software registries have become a recurring industry problem, with criminals taking over maintainer accounts, publishing lookalike packages, and slipping malicious code into genuine project updates. Python code is especially exposed because installation can execute scripts on the user’s computer, and damage can start without importing or running the package. OX Security said the malicious agent-framework shows attackers are targeting the AI developer ecosystem and the CI pipelines behind it.

BleepingComputer put monthly downloads at roughly 200,000 on PyPI. OX Security cited 192,534 monthly downloads, while The Hacker News cited about 190,000 downloads a month. Wiz put weekly downloads at about 41,000 for the package. The download figures differ depending on the source.

Anyone who pulled either malicious release should isolate affected environments, stop running Python or pip until they secure the environment, then rebuild from a clean environment using the safe 1.26.0 release.

Security teams should inspect all environments, CI images, and lockfiles, then remove either malicious version wherever it appears. Build agents and hosts running 1.26.1 may contain agent_framework_meta.pth plus agent_framework_meta/_telemetry.py, while version 1.26.2 relies on af_runtime_diag.pth and af_runtime_diag.py.

Teams should pin agent-framework to a verified Microsoft release using hash checking and block outbound traffic to webhook.site from build infrastructure. Aikido Security said removing the package stops future runs but cannot reverse data already exfiltrated.

OX advised teams to rotate OpenAI tokens, Hugging Face secrets, Docker keys, NuGet logins, PyPI access, npm credentials, GitHub tokens, personal access tokens, and Azure service principal secrets, and to treat all secrets reachable from a host as compromised if the package ran there. Rotating stored secrets does not cover tokens already issued.

Wiz and Note.com said to check Azure sign-in and activity logs for managed identities and federated credentials from affected build agents. According to Wiz and Note.com, stolen managed-identity and OIDC-exchanged tokens remain valid for as long as 24 hours.

Note.com said systems running only agent-framework-core are not affected, and the affected window covered only unpinned installs from 5:35 AM to about 6:30 AM JST on Nov. 18. PEP 829 marks the .pth import line as deprecated and schedules it to be ignored starting with Python 3.18, leaving the entry point open until then.

The warning signs are outbound traffic to webhook.site from build infrastructure, a 200 response meaning stolen data was accepted, and 410 or 429 responses meaning it was rejected.

Was this helpful?

Join the discussion

Please read our Comment Policy before commenting. First-time comments are held for moderation. By posting a comment you agree to our Terms of Use and Privacy Policy, which explain how your name, email address and comment are used.

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