Skip to content
audiotale.net
Sign in
NewsNews

agent-framework 1.26.1 and 1.26.2 on PyPI steal credentials: what to do

Two malicious releases of Microsoft's agent-framework package ran a credential stealer at Python startup on 17 November before PyPI quarantined them; 1.26.0 is the clean version.

audiotale.net team

· 6 min read

Written by AI from the sources linked below. How we use AI

On this page
  1. Key points
  2. What to do
  3. What happened
  4. Background
  5. How it works
  6. The numbers
  7. What it means
  8. What we don't know yet
  9. What to watch next
  10. Sources

Microsoft's agent-framework package on PyPI was hijacked on 17 November 2026: versions 1.26.1 and 1.26.2 carried a credential stealer that runs every time Python starts, whether or not the framework is imported. PyPI quarantined both versions the same day, and the clean release is 1.26.0. If either bad version was installed anywhere, treat the host or CI runner as compromised and rotate every secret it could reach.

Key points

  • agent-framework 1.26.1 and 1.26.2 on PyPI were malicious; both were published on 17 November 2026 and later quarantined (StepSecurity, Socket, BleepingComputer).
  • Each version installs a .pth startup hook, so the payload runs at Python startup even if the package is never imported.
  • The code harvests environment variables, credential files and Azure and GitHub Actions identity tokens and sends them in one POST to a webhook.site address.
  • The second malicious version was uploaded 2 minutes 23 seconds after the first was quarantined (StepSecurity), which suggests the attacker kept publishing access.
  • How the attacker got in is not established, and BleepingComputer had no response from Microsoft when it published.

What to do

Check whether you are affected. Run pip show agent-framework or search lockfiles, caches, mirrors and container images for agent-framework==1.26.1 or 1.26.2. In site-packages, look for agent_framework_meta.pth and agent_framework_meta/_telemetry.py (1.26.1) or af_runtime_diag.pth and af_runtime_diag.py (1.26.2), plus cached bytecode. Note that 1.26.2 restores the legitimate __init__.py, so checking that file alone misses it (Socket).

If you find them.

  1. Isolate the host, container or runner, and avoid running Python or pip in it, because the hook can fire again (StepSecurity). Removing the hook does not stop a collector that is already running.
  2. Prefer rebuilding from a clean base image, pinned to agent-framework==1.26.0 with hash-pinned lockfiles.
  3. Rotate credentials from a clean machine: CI secrets, cloud keys, registry and Docker credentials, Git credentials, Hugging Face tokens, Azure CLI caches and service connections.
  4. Review identity trust: GitHub OIDC permissions, Azure federated credentials, Azure DevOps service connections and managed-identity role assignments. StepSecurity warns that deleting a trust relationship does not necessarily revoke tokens already issued.
  5. Search egress logs for the webhook.site path d381fd80-ec62-42ad-8f5c-d1b15103c9bb and the user agents runtime-diagnostics/1 and af-runtime-diagnostics/1. Distinguish blocked requests from completed transfers.

If you did not install either version. Nothing to do beyond pinning. PyPI's own page lists 1.26.0, released 12 November, as the latest release, with no sign of the bad versions.

What happened

According to StepSecurity's timeline (all times UTC): the clean 1.26.0 was published on 12 November at 18:24. On 17 November at 20:35:20, a malicious 1.26.1 appeared, as a wheel only and with no provenance attestation. PyPI quarantined it at 21:06:16. At 21:08:39, a 1.26.2 was uploaded, and it was quarantined at 21:16:44.

Socket and BleepingComputer report the same versions and the same day. BleepingComputer, which says the package has roughly 200,000 monthly downloads, notes that both bad releases kept the dependency on the legitimate agent-framework-core 1.26.0, so applications kept working normally and nothing looked broken. It also credits Socket, StepSecurity and Ox Security with documenting the attack.

Background

Python supports .pth files in site-packages: any line beginning with import is executed when the interpreter starts, through the site module. That is the mechanism these releases abuse, and it is why not importing the framework protects nobody: the code runs on any python or pip invocation in that environment.

The package sits in a fast-growing corner of the ecosystem. Microsoft's Agent Framework is a library for building AI agents, and agent projects tend to run with exactly the credentials an attacker wants: cloud identities, model API keys and CI tokens. The incident is a reminder of why we covered PyPI's new provenance and attestation display: StepSecurity notes that the malicious 1.26.1 wheel had no provenance, while the framework's own 1.26.0 page shows "No provenance found" too, so a missing attestation on its own would not have separated bad from good here.

How it works

Both versions run a collector at interpreter startup. In 1.26.1 the chain is agent_framework_meta.pth, then agent_framework_meta/__init__.py, then _telemetry.py. StepSecurity says 1.26.1 also appended eight lines to __init__.py. In 1.26.2 the hook was reduced to a one-line import of af_runtime_diag.py, and __init__.py went back to its clean 1.26.0 content, which makes the newer version harder to spot.

On Unix the payload forks a child, detaches it with setsid() and sets an environment variable, _AF_TEL, to stop descendants from collecting again. The child can outlive the parent interpreter. Socket adds that there is no persistent on-disk marker, so a new process tree can trigger collection again. Both teams report no second-stage download and no scheduled task or service in the payloads they inspected.

What it goes after, per Socket and StepSecurity:

  • Environment variables whose names contain strings such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB and OPENAI; 1.26.2 adds ACTIONS, OIDC, RUNNER and ARM_.
  • The environments of other processes, read from /proc/*/environ.
  • Credential and config files: Azure CLI files, Azure DevOps agent credentials, pip, npm, netrc, git and Docker configs, Hugging Face and Foundry tokens, and .env files.
  • Freshly requested Azure managed-identity tokens and Azure DevOps federation tokens (both versions), plus GitHub Actions OIDC tokens (1.26.2 only).

The data is serialised to JSON, compressed with zlib, base64-encoded and posted to a webhook.site URL. StepSecurity points out that this is encoding, not encryption. It also stresses that these are behaviours found through static analysis, and it does not confirm that any token was successfully issued or any cloud account accessed.

The numbers

The two uploads were minutes apart, which is the most telling figure in the incident.

Minutes each malicious release stayed up before PyPI quarantine, 17 November 2026minutes
Minutes each malicious release stayed up before PyPI quarantine, 17 November 2026 (minutes)
minutes
1.26.130.9
1.26.28.1

Source: StepSecurity timeline (UTC upload and quarantine times)

Those values come from the timestamps above: 1.26.1 went up at 20:35:20 and was quarantined at 21:06:16 (about 31 minutes); 1.26.2 went up at 21:08:39 and was quarantined at 21:16:44 (about 8 minutes). The window was short, but any CI job that resolved an unpinned agent-framework in that period could have installed the bad code, and downloads are cached by mirrors.

What it means

For teams building agents, the lesson is about blast radius. A dependency that runs at interpreter start gets the same access as your application, and agent workloads often hold broad cloud and model credentials. Pin exact versions and hashes, limit what CI runners can mint with OIDC, and block outbound traffic to anything not on an allowlist; StepSecurity recommends egress controls such as Harden-Runner for CI.

For Microsoft and PyPI, the open question is account security. StepSecurity says the evidence does not establish the initial access vector, the account or credential used, or the uploader's identity. It does mention a maintainer account named vibiret, created and added to the project on 17 November, but does not explain how that is linked to the compromise, and we draw no conclusion from it. The uploader's user agent was RestSharp/106.13.0.0, which StepSecurity says only identifies the client the request claims to use, not who operated it.

What we don't know yet

  • How the attacker obtained publishing access, and whether it has been fully revoked.
  • Whether the upstream GitHub repository or its CI were affected: neither Socket nor StepSecurity says.
  • How many environments installed the bad versions before the quarantine.
  • Whether any stolen token was actually used. Neither team confirms successful token issuance.
  • Microsoft's position: BleepingComputer had no reply by publication, and none of the three reports quotes a Microsoft statement.

What to watch next

Watch for a Microsoft advisory or post-incident note, a PyPI statement on the account, and any new release of the package. Satellite packages (agent-framework-openai, -redis, -postgres, -purview, -tools) had no uploads after 12 November at the time StepSecurity checked. Expect security vendors to add the IoCs to their feeds.

Sources

Written by

audiotale.net team

The official account of the people who run audiotale.net: announcements, conversation starters and the newsroom's drafts. Posts written with AI say so. Every other account here is a real person.