Skip to content

All posts

IT security, Supply chain, Incident response

PSA: Compromised Python package steals cloud and CI credentials

Microsoft Agent Framework: on 17 November 2026, versions 1.26.1 and 1.26.2 of the agent-framework package on PyPI carried a credential stealer that runs on every Python start and collects secrets for Azure, Azure DevOps, GitHub Actions, package registries and AI services. Check whether either version was installed, rebuild the environment, rotate secrets. Status as of 20 November 2026.

Status as of 20 November 2026, 18:30 CET. This is based on entry GHSA-764m-3ppc-5m73 in the GitHub Advisory Database (type malware, severity critical), on the Python Packaging Authority notice PYSEC-2026-4388 and on the analyses by Wiz and JFrog. On PyPI, 1.26.0 is again the latest version; 1.26.1 and 1.26.2 have been removed. As of this update we have not found a security notice from Microsoft itself, neither on the Microsoft Security Response Center blog nor in the Security Update Guide.

On the evening of 17 November 2026, two versions of an official Microsoft package appeared on PyPI, the public package index for Python, and both contained a credential stealer. The package is agent-framework, the entry package of Microsoft Agent Framework, a toolkit for building AI agents. Version 1.26.1 arrived at 21:35 CET, version 1.26.2 at 22:08 CET. Both collect credentials on the machine they are installed on and send them to a third-party server. According to JFrog, both versions were gone by 22:16 CET; Wiz gives 22:30 CET. Version 1.26.0 from 12 November and all earlier versions are clean.

The versions were published under the real package name and through Microsoft’s own release path. Anyone who checked the name and trusts Microsoft as a supplier would have noticed nothing. Wiz writes that the attacker appears to have held a client certificate and private key for ESRP, the internal service Microsoft uses to sign and publish this package. A first attempt from AWS was rejected by an IP filter, a second one from Microsoft-owned address space succeeded. How the attacker obtained the certificate is not known. JFrog examined the packages and writes that they were repacked by hand outside Microsoft’s regular build pipeline. A vendor with its own signing service and its own security team can be hit just like a one-person project once someone holds the right to publish. So far Microsoft has commented only in a statement to The Register: it has made some repositories private while it investigates malicious content. Microsoft has not said whether the certificate has since been revoked or how it was lost. In PYSEC-2026-4388 the Python Packaging Authority states that both versions were uploaded without authorization and that the PyPI security team worked with Microsoft to review the project’s accounts and complete remediation. The project’s GitHub repository was still unreachable on 20 November at 18:05 CET.

Where this reaches you

The first to be hit are the developer setting up an agent prototype on a Tuesday evening and the build agent in Azure DevOps or GitHub Actions that resolves dependencies fresh on every run. A container image built during that hour carries the version onwards. JFrog reports that bots such as Renovate had already opened update pull requests in downstream repositories six minutes after 1.26.1 appeared. Whoever clicked “merge” the next morning pulled the version into their own project even though PyPI had long deleted it, provided an internal package mirror had cached it.

According to pypistats.org, the package is downloaded about 39,000 times a week and about 193,000 times a month, across all versions. For the two malicious versions, the public PyPI download data, which can be queried through ClickPy, shows 427 downloads on 17 November and 562 in total up to and including 19 November. These figures include scanners, sandboxes and package mirrors. They do not tell how many real installations are behind them.

Why installing it is enough

When a Python interpreter starts, it reads certain small control files in the package directory, recognisable by the extension .pth. Normally they only add search paths. If such a file contains a line starting with import, however, Python executes it as code. Both versions shipped exactly such a file.

As a result, the malicious code runs on every Python start in that environment, even if your own application never loads the package. A test run, a script, the IDE’s language server, a container start or a call to pip is enough. JFrog explicitly points out that even pip uninstall runs the code once more before the package is gone. The framework itself keeps working, because the malicious versions still pull in the clean core package agent-framework-core 1.26.0. Nobody sees an error.

What the stealer collects

GitHub, Wiz and JFrog agree on the following:

  • Environment variables whose names suggest keys and tokens (such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, OPENAI, NPM), on Linux also from the environments of other running processes.
  • Credential files: Azure CLI sign-in data, .npmrc, pip.conf, .netrc, stored Git credentials, the Docker configuration, Hugging Face tokens, the .credentials of self-hosted Azure DevOps agents, and .env and JSON files under /app and /workspace.
  • Fresh Azure tokens: on an Azure VM, in App Service or on an AKS node, it asks the metadata service for managed-identity tokens for twelve targets, including Azure Resource Manager, Key Vault, Storage, Microsoft Graph and Azure DevOps.
  • Federation tokens from pipelines. Many pipelines now sign in to Azure without a stored password: each run receives a short-lived OIDC token, and Entra ID trusts that token through a configured binding (federated credential). Version 1.26.1 tries this for Azure DevOps, version 1.26.2 additionally for GitHub Actions in workflows with id-token: write. JFrog writes that the Azure DevOps request is malformed and gets rejected; the pipeline token SYSTEM_ACCESSTOKEN still leaks if it is present in the environment.

Tokens like these cannot be rotated. According to Wiz and JFrog they are valid for up to 24 hours. Tokens from the evening of 17 November have expired by now; what an attacker did with them in that time shows up only in the sign-in logs.

The code is tailored to Linux, meaning build agents and containers. According to JFrog it also runs on Windows and macOS but collects less reliably there.

How much damage was done

The stolen data went to a free service for capturing web requests. Its free tier accepts only a limited number of requests and discards the rest. Wiz analysed the 50 requests stored there: four came from the attacker, 29 from sandboxes, scanners and tests, and the remaining 17 from three real victim environments. When JFrog checked, the service only returned a message that the limit had been reached.

That suggests the attacker captured far less than the download figures might imply. For an individual organisation it changes little: only your own proxy and DNS logs show whether your data was among the accepted requests. JFrog also notes that such free inboxes can be readable by anyone who knows their address. We therefore treat every environment in which either version ran as compromised.

Who is affected and who is not

Only the agent-framework package from PyPI in versions 1.26.1 and 1.26.2 is affected. When we checked on 20 November, the core package agent-framework-core and the other agent-framework-* packages on PyPI had no version newer than 12 November, and none of the sources lists them as affected. The framework’s main .NET package on NuGet (Microsoft.Agents.AI) last received a version on 6 November. Wiz recalls that earlier this year another Microsoft Python package, durabletask, was compromised after a PyPI token was stolen, but sees no link.

Check and act

1. Was 1.26.1 or 1.26.2 installed anywhere? Search lockfiles (requirements*.txt, poetry.lock, uv.lock, Pipfile.lock), CI and build logs from 17 and 18 November, container images from that period, pip and uv caches, and internal package mirrors such as Artifactory or Nexus. Also check pull requests from Renovate or other bots from 17 and 18 November that have since been merged. Any unpinned installation resolved on 17 November between 21:35 and about 22:30 CET is critical, as is any later installation from a mirror that cached the version.

2. Look for the files. In the package directory (site-packages), 1.26.1 leaves agent_framework_meta.pth and agent_framework_meta/_telemetry.py, 1.26.2 leaves af_runtime_diag.pth and af_runtime_diag.py. Search for all four names; looking only for the 1.26.1 names misses 1.26.2. If either .pth file is present, the code ran on every Python start in that environment. According to JFrog, compiled .pyc files do not show whether it ran.

3. Rebuild the environment. Rebuild the virtual environment, container image, VM or self-hosted build agent from a clean base with agent-framework==1.26.0, and re-register self-hosted Azure DevOps agents. If you need to preserve or examine the old environment first, keep in mind that every Python call in it, including pip, runs the code again. JFrog recommends setting the environment variable _AF_TEL=1 beforehand; the malicious code itself uses it as a guard against running twice.

4. Rotate everything the environment could reach. That includes all secrets in environment variables and .env files, including those of other processes on the same host, API keys for language models, Azure DevOps PATs and service connections, tokens for npm, PyPI, NuGet, Docker and Hugging Face, and Git credentials. If Azure CLI sign-in data was on disk, a new password is not enough: the account’s sessions in Entra ID must be revoked so that cached refresh tokens become invalid.

5. Review managed identities and OIDC bindings. For every managed identity and every binding reachable from an affected VM, app, AKS node or pipeline, review the Entra ID sign-in and activity logs from the evening of 17 November onwards. For GitHub workflows with id-token: write that installed 1.26.2, review the federated credentials that trust that repository and the sign-ins of the matching app registration. Where roles are broader than needed, cut them back now.

6. Pin your versions and let new ones wait. Pin dependencies in build and deployment to exact versions with checksums: with pip install --require-hashes and a requirements file in which every line carries a --hash, or through the uv or Poetry lockfile, which records the checksums. A fixed version 1.26.0 would have prevented the silent update to 1.26.1; the checksum makes sure that exactly the reviewed file is installed under that number.

Accept new versions only after a waiting period. In Renovate, the minimumReleaseAge setting does this, for example "3 days". With default settings Renovate then skips younger versions and only proposes one that has passed this period. According to GitHub’s documentation, Dependabot already waits three days for version updates, adjustable through cooldown; this waiting period does not apply to security updates. That only protects the bots’ update pull requests. Pipelines that resolve packages without a lockfile need the waiting period in the installer itself: uv offers exclude-newer with a duration such as "7 days", current pip versions the option --uploaded-prior-to P7D. Both require the package index or the internal mirror to provide the upload time.

If agent-framework 1.26.1 or 1.26.2 was installed in an environment, every secret that environment could read or request counts as known. The environment gets rebuilt, the secrets get rotated, and the sign-ins of the reachable identities get reviewed. Everyone else should switch the Python dependencies in their pipelines to fixed versions with checksums.