CTIPilot
AI-generated · no human review · verify critical claims against the linked source. how it works →
← Back to the live brief
NOTABLENATOB1incident

Microsoft's agent-framework package on PyPI, versions 1.26.1 and 1.26.2 published on 2026-11-17, carried a credential stealer that a .pth startup hook runs every time Python starts, collecting environment secrets and requesting Azure managed-identity, Azure DevOps and GitHub Actions OIDC tokens; both versions were removed and 1.26.0 is the last clean release

Microsoft's agent-framework on PyPI carried a Python-startup credential stealer in 1.26.1 and 1.26.2; pin 1.26.0

Defender actions

  • Search lockfiles, requirements files and CI install logs for agent-framework 1.26.1 or 1.26.2 installed since 2026-11-17 20:35 UTC, and on every host or job that ran Python after installing either, treat the environment variables, local credential files, Azure managed-identity and Azure DevOps tokens and, for 1.26.2, GitHub Actions OIDC tokens as stolen and rotate them, then pin agent-framework to 1.26.0 or earlier.

Analysis

Socket reports that the Microsoft agent-framework PyPI package was compromised on 2026-11-17, in versions 1.26.1 and 1.26.2, both of which install Python startup hooks that collect credentials, environment data and cloud identity tokens and send them to a web endpoint (Socket, 2026-11-17). SafeDep, which flagged both releases independently, says the project is Microsoft's official metapackage, published under the microsoft account on PyPI, that 1.26.1 appeared at 20:35 UTC and 1.26.2 at 21:08 UTC, that each is a single wheel where earlier releases shipped a wheel and a source archive, and that both were removed from PyPI and 1.26.0 is the last clean release (SafeDep, 2026-11-18). The attacker published 1.26.2 after 1.26.1 was gone, so removing one version did not stop it, and how it obtained publishing access is not known (SafeDep, 2026-11-18).

Nothing has to import the package: a .pth file runs on Python startup, imports a module and launches collection in a background process or thread, so a pip install in a CI job is enough (Socket, 2026-11-17; SafeDep, 2026-11-18). 1.26.1 routes through the package's own initializer, while 1.26.2 moves the payload to a new top-level module and restores the legitimate initializer byte for byte, so checking only the initializer misses it (Socket, 2026-11-17). The code matches environment variables by substring, such as TOKEN, SECRET, KEY and AZURE, reads other processes' environments and credential files for pip, npm, netrc, git, Docker, Hugging Face and Foundry, and actively requests fresh Azure managed-identity and Azure DevOps tokens, with GitHub Actions OIDC tokens added in 1.26.2; it compresses the result and posts it to a web endpoint and downloads no further code (Socket, 2026-11-17). There is no persistent on-disk marker, so fresh process trees can trigger collection again (Socket, 2026-11-17).

Cited evidence

On Python startup, the .pth file imports a module that launches collection in a background process/thread.

Socket Research Team 2026-11-17

The last clean release is 1.26.0.

How the attacker got publishing access is not known yet.

SafeDep 2026-11-18

Sources2

PROVENANCE

AI-generated · no human review · this permalink is the shareable record for the finding · verify operationally critical claims against the linked primary source.