
Attackers Compromise Microsoft's Agent Framework PyPI Package to Steal Cloud Credentials
Malicious versions 1.26.1 and 1.26.2 of Microsoft's agent-framework PyPI package ran a credential stealer on every Python start and exfiltrated cloud credentials to a webhook endpoint.
Attackers compromised Microsoft's agent-framework package on PyPI and published malicious versions 1.26.1 and 1.26.2 on November 17, 2026. The versions were released 33 minutes apart and are designed to run a credential stealer on every Python start. Both release versions have since been quarantined on PyPI.
How the stealer runs
Once installed, each wheel adds a .pth file to site-packages. Python executes import lines in .pth files on every interpreter start, so the stealer runs on any Python launch in an affected environment, including pip itself, whether or not anything imports Agent Framework. Version 1.26.1 uses agent_framework_meta.pth, while version 1.26.2 uses af_runtime_diag.pth.
What is collected
Socket said both versions install Python startup hooks that silently collect credentials, environment data, and cloud identity tokens, then exfiltrate them to a webhook.site endpoint. The stealer captures environment variables based on substring matching, credential files for Azure CLI, .npmrc, pip.conf, .netrc, .git-credentials, Docker config, Hugging Face, Microsoft Azure DevOps agents, and .env and JSON files. It also captures Azure DevOps OIDC tokens, Azure managed-identity tokens, and Azure instance metadata, retaining up to 8,000 characters of the response.
Issuing new credentials
SafeDep said the code asks the platform to issue new credentials, so rotating stored secrets does not cover those. In an Azure DevOps pipeline, SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI are enough to request a federated token for api://AzureADTokenExchange. On Azure compute, it asks the managed identity endpoint for an access token to each resource, using IDENTITY_ENDPOINT or MSI_ENDPOINT on App Service and Functions, and 169.254.169.254 elsewhere. It also pulls instance metadata.
Exfiltration and response
All collected information is saved into a JSON document, zlib-compressed, Base64-encoded, and sent via HTTPS POST to a hard-coded URL, webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb. Version 1.26.2 also imports af_runtime_diag.py, collects GitHub Actions OIDC tokens, and expands search patterns for credential-related environment variables. It is unclear how the attacker obtained publishing access. Users are advised to isolate affected hosts and runners, pin the package to version 1.26.0, restore from a clean environment, check exposure between 8:35 and roughly 9:20 p.m. UTC on November 17, 2026, search proxy and DNS logs, rotate exposed credentials from a clean system, audit Azure identities and activity logs, and audit GitHub Actions workflows that deploy to Azure. OX Security said attackers may have found a way to hijack the wheel creation flow to add malicious logic inside. Agent-framework is the second Microsoft-related PyPI package compromised this year; in May 2026, threat actors behind TeamPCP pushed three malicious versions of durabletask to distribute the Mini Shai-Hulud worm.
Sources: The Hacker News
SiTech — AI-powered web development
We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.