Be first to know. Be ready to defend.

Hijacked releases of Microsoft's agent-framework package stole cloud credentials on install

Malware
Illustration of a terminal installing agent-framework 1.26.2, which adds a .pth file that runs every time Python starts and sends tokens and keys to a webhookIllustration of a terminal installing agent-framework 1.26.2, which adds a .pth file that runs every time Python starts and sends tokens and keys to a webhook

On the evening of 17 November, someone published two unauthorised versions of agent-framework, Microsoft’s official Python package for building AI agents, to the Python Package Index (PyPI). Both contained a credential stealer. According to PyPI’s security advisory, anyone who installed version 1.26.1 or 1.26.2 should treat that system as compromised.

Both versions have been removed. PyPI says its security team “worked with Microsoft to review the project’s accounts and complete remediation steps”, and that the previous release, 1.26.0, is not affected. The package is downloaded about 196,000 times a month, according to PyPI Stats.

What happened

The malicious versions were uploaded 33 minutes apart, according to Wiz, which analysed both:

Timeline of 17 November 2026 in UTC: 20:35, version 1.26.1 uploaded; 21:08, version 1.26.2 uploaded; by about 21:30, both versions no longer available on PyPI; 22:12, listed in the open-source malware database; 23:18, PyPI publishes its security advisoryTimeline of 17 November 2026 in UTC: 20:35, version 1.26.1 uploaded; 21:08, version 1.26.2 uploaded; by about 21:30, both versions no longer available on PyPI; 22:12, listed in the open-source malware database; 23:18, PyPI publishes its security advisory

Neither version came from Microsoft’s normal release process. Wiz found no 1.26.1 release or tag in the agent-framework repository, and the malicious code is not in its source. PyPI says both were repackaged from the legitimate 1.26.0 release.

A researcher at Upwind Security reported the problem on the project’s GitHub page. A Microsoft maintainer replied there that “the compromised versions for agent-framework: 1.26.1, 1.26.2 have been pulled from the package feed”, adding: “We’re actively investigating the issue and will share more details as soon as we can.”

Installing it was enough

Each malicious version added a .pth file to the Python installation. Python runs these files every time it starts, so the stealer ran even if no code ever imported agent_framework. Any Python process in an affected environment, including test runs and unrelated scripts, would trigger it.

Diagram of how the stealer runs: installing 1.26.1 or 1.26.2 adds a .pth file; Python runs it every time it starts, even without importing the package; it collects environment variables, credential files and Azure and CI tokens; and it sends them in one compressed request to a webhook.site address. Version 1.26.2 also requests GitHub Actions OIDC tokens that can sign in to AzureDiagram of how the stealer runs: installing 1.26.1 or 1.26.2 adds a .pth file; Python runs it every time it starts, even without importing the package; it collects environment variables, credential files and Azure and CI tokens; and it sends them in one compressed request to a webhook.site address. Version 1.26.2 also requests GitHub Actions OIDC tokens that can sign in to Azure

According to PyPI, Wiz and Socket, the stealer collected:

It packed everything into one compressed message and sent it to a webhook.site address. Wiz notes that stolen cloud tokens can stay valid for up to 24 hours.

An hour was enough

The bad versions were only up for about an hour. Agent frameworks run in build pipelines, cloud workloads and developer machines with access to production, which is where the most powerful credentials live. One CI run that pulled the latest version in that hour could have handed over the keys to an organisation’s cloud environment.

Systems with the dependency pinned to 1.26.0 in a lockfile were not affected unless someone upgraded during the window. Only the agent-framework package itself is listed in the advisories. Its companion packages, such as agent-framework-core, are not.

Open questions

Microsoft has not said how the attacker got publishing access, whether through a maintainer account or an upload token, and no group has been named. The number of victims is also unclear, but it can’t be large. Wiz says the attacker used a free webhook.site account, which accepts at most 100 requests, and that at most 50 were captured.

This is the second Microsoft Python package compromised on PyPI this year. In May, malicious versions of durabletask were published through a compromised maintainer account. Wiz says it has not linked the two incidents.

Indicators of compromise

From PyPI’s advisory, Wiz and Socket. Domains are written in “defanged” form, with [.] in place of the dot:

Versions     agent-framework 1.26.1, 1.26.2
Files        agent_framework_meta.pth, agent_framework_meta/_telemetry.py (1.26.1)
             af_runtime_diag.pth, af_runtime_diag.py (1.26.2)
Endpoint     hxxps://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetry
User-Agent   af-runtime-diagnostics/1 (1.26.1), runtime-diagnostics/1 (1.26.2)
Env marker   _AF_TEL set in child processes
SHA-256      d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110  (1.26.1 wheel)
             3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9  (1.26.2 wheel)

Checking and cleaning up

  1. Search lockfiles, CI logs, virtual environments and container images for agent-framework 1.26.1 or 1.26.2, and look for the .pth files above in site-packages.
  2. Pin to 1.26.0 and rebuild affected environments and images from scratch. Uninstalling the package won’t undo anything, because the payload has already run.
  3. Search proxy and DNS logs for the webhook address. Wiz says a 200 response means the data was accepted.
  4. From a clean machine, rotate every credential the affected systems could reach. That includes Azure CLI sessions, Azure DevOps personal access tokens and service connections, cloud keys, GitHub tokens, and npm, PyPI, Docker and Hugging Face tokens.
  5. Check Microsoft Entra ID sign-in and activity logs for the managed identities and app registrations that affected systems used. For 1.26.2, also review GitHub Actions workflows that deploy to Azure, and the federated credentials they use.
  6. For next time, pin dependencies with hashes, hold back brand-new releases in CI where you can, and give build jobs only the cloud permissions they need.

We have covered two other attacks through trusted software this week: the Optimizely attack on websites, and attackers abusing AI coding tools inside developers’ own repositories.