Skip to content

Defender Daily

Microsoft’s agent-framework package on PyPI briefly carried a credential stealer

Affected
agent-framework 1.26.1 and 1.26.2 on PyPI, both now removed. All versions and fixes

Two versions of agent-framework, the PyPI package for Microsoft Agent Framework, carried a credential stealer on Nov 17, Wiz says. Versions 1.26.1 and 1.26.2 went up at 3:35 p.m. and about 4:08 p.m. ET, and both were gone by 4:30 p.m. ET. Each runs its stealer whenever Python starts, even if the package is never imported, and sends Azure, CI and registry credentials to a webhook[.]site address. The last safe version is 1.26.0.

Each version drops a .pth file into the site-packages folder: in 1.26.1 and in 1.26.2. Python runs such files every time it starts, so the stealer runs in that environment whether or not agent-framework is used. It forks into the background and names itself like SDK telemetry. Searching only for the first version’s file names misses the second, Wiz notes.

The stealer collects environment variables whose names suggest secrets, secret-looking values from other processes’ environments, and up to 60 credential files. Those include Azure CLI, npm, pip, git, Docker and Hugging Face credentials and Azure DevOps agent files. It also requests Azure DevOps OIDC tokens and Azure managed-identity tokens for 12 resources, including Graph and Key Vault. Version 1.26.2 adds GitHub Actions OIDC tokens, which can be exchanged for Azure access where Entra ID trusts the workflow.

How the attacker got publishing access isn’t confirmed. Microsoft’s GitHub repository has no matching tag or release, and 1.26.1 shipped as a wheel only, without the source package and matching agent-framework-core release that real versions have. Wiz says that suggests an upload outside the project’s normal release process. Another Microsoft Python package, durabletask, was compromised earlier this year through a stolen PyPI token, but Wiz hasn’t linked the two.

The package gets about 41,000 downloads a week. The attacker’s webhook[.]site address was on the free tier, which accepts at most 100 requests, and Wiz confirmed that no more than 50 were captured. Those requests can still hold working cloud, CI and registry credentials. Stolen managed-identity and OIDC-exchanged tokens stay valid for up to 24 hours, Wiz notes.

Vendor
Microsoft

What to do

6 steps

Affected and fixed versions

  • Product
    agent-framework on PyPI
    Affected
    1.26.1 and 1.26.2
    Fixed
    1.26.0, the last safe version

Indicators

URLs copy defanged. Use Copy raw for queries.

URLExfiltration endpoint, called with ?t=telemetry
User agentExfiltration user agent in 1.26.1
User agentExfiltration user agent in 1.26.2
File nameStartup hook in site-packages, from 1.26.1
File nameCredential stealer, from 1.26.1
File nameStartup hook in site-packages, from 1.26.2
File nameCredential stealer, from 1.26.2
SHA-1_telemetry.py
SHA-256af_runtime_diag.py
SHA-256af_runtime_diag.pth
SHA-256agent_framework-1.26.1-py3-none-any.whl
SHA-256agent_framework-1.26.2-py3-none-any.whl

Timeline

  1. Nov 12The legitimate agent-framework 1.26.0 is published on PyPI.
  2. Nov 17Malicious 1.26.1 goes up on PyPI at 3:35 p.m. ET.
  3. Nov 17Malicious 1.26.2 follows at about 4:08 p.m. ET.
  4. Nov 17Both versions are gone from PyPI by about 4:30 p.m. ET.
  5. Nov 17Wiz publishes its analysis.

Sources

Subscribe

Get the Daily Brief by email

Weekdays at 7am ET.

We’ll email you a link to confirm. Unsubscribe from any email.