AI Security

Microsoft: 2 Malicious PyPI Versions of agent-framework Install Credential Stealer

Two malicious versions of Microsoft's official agent-framework PyPI package, published 33 minutes apart on November 17, 2026, installed a credential stealer that exfiltrated secrets and cloud identity tokens to an attacker-controlled webhook.site endpoint. Both versions are now quarantined; the publishing-access mechanism remains unexplained.

Y
Yso Series
November 18, 2026 · 4 min read · 6
supply-chainpypimicrosoftcredential-stealeragent-frameworkci-cd

Two malicious versions of Microsoft's official agent-framework package on PyPI, published 33 minutes apart on November 17, 2026, installed a credential stealer that collected secrets, environment data, and cloud identity tokens and exfiltrated them to an attacker-controlled webhook.site endpoint, according to The Hacker News and Socket. The affected versions, 1.26.1 and 1.26.2, were published between 8:35 and roughly 9:20 p.m. UTC on November 17, 2026, and both have since been quarantined on PyPI. The package, a meta-package for the open-source Microsoft Agent Framework used to build and orchestrate AI agents in Python, draws about 190,000 downloads a month. How the attacker obtained publishing access remains unclear.

What was the specific vulnerability?

The compromise consisted of two malicious releases of the agent-framework meta-package that installed Python startup hooks to silently harvest and exfiltrate credentials from any affected environment. Each version drops a .pth file in the site-packages root directory: agent_framework_meta.pth in version 1.26.1 and af_runtime_diag.pth in version 1.26.2. Because .pth files execute automatically on every Python interpreter start, the stealer runs on any Python launch in an affected environment, "including pip itself, whether or not anything imports Agent Framework," as Endor Labs reported, cited by The Hacker News.

The stealer captures environment variables through substring matching against terms including TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI, HF_, FOUNDRY, TENANT, CLIENT, and MANAGED, with version 1.26.2 adding ACTIONS, OIDC, RUNNER, and ARM_. It also reads credential files on disk, including ~/.azure/.json, .npmrc, pip.conf, .netrc, .git-credentials, .docker/config.json, Hugging Face credentials, Azure DevOps agent credentials, and .env and JSON files, and it reads other processes' environments via /proc//environ.

Beyond reading credentials already on disk, the code requests fresh ones. "Besides reading credentials already on disk, the code asks the platform to issue new ones," SafeDep said, as reported by Socket. "Rotating stored secrets does not cover those." The stealer requests fresh Azure DevOps OIDC and federated tokens through api://AzureADTokenExchange and Azure managed-identity tokens via IDENTITY_ENDPOINT, MSI_ENDPOINT, or the 169.254.169.254 metadata address, and it pulls Azure instance metadata of up to 8,000 characters. Version 1.26.2 adds GitHub Actions OIDC token collection.

Collected data is saved as JSON, zlib-compressed, Base64-encoded, and sent by HTTPS POST to a hard-coded endpoint, webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb, with a ?t=telemetry parameter in version 1.26.2. According to Socket, the payloads do not download or execute additional code.

How was the incident detected?

The compromise was discovered and reported on November 17, 2026, the same day the malicious versions were published, by eight security firms: Aikido, Chainguard, Endor Labs, OX Security, SafeDep, Socket, StepSecurity, and Google-owned Wiz. The two versions went live on PyPI between 8:35 and roughly 9:20 p.m. UTC that day, 33 minutes apart, and both were quarantined on PyPI after the reports. The Hacker News carried the coordinated disclosure, and Socket published its own technical analysis of the startup hooks and exfiltration channel. The mechanism by which the attacker obtained publishing access to the official package has not been explained.

What is the current impact?

Users of the agent-framework package who installed versions 1.26.1 or 1.26.2 had Azure, GitHub Actions, and CI/CD credentials, environment secrets, and cloud identity tokens exfiltrated on every Python start, including on CI runners where pip itself triggers the hook. The package's roughly 190,000 monthly downloads define the exposure surface, though only installs of the two malicious versions within the November 17, 2026 publication window are affected. Both versions are now quarantined on PyPI, and the last safe version is 1.26.0.

"Both versions install Python startup hooks that silently collect credentials, environment data, and cloud identity tokens, then exfiltrate them to a webhook[.]site endpoint," Socket said in its report. "The malicious agent-framework shows how attackers are targeting the AI developer ecosystem and the CI pipelines behind it," OX Security said, according to The Hacker News. "While directly targeting an official Microsoft package, it seems that attackers found a way to hijack the wheel creation flow to add malicious logic inside."

This is the second Microsoft-related PyPI package compromised in 2026. In May 2026, the TeamPCP actors pushed three malicious versions of the durabletask package distributing the Mini Shai-Hulud worm.

What are the next steps?

The recommended remediation is to pin agent-framework to the last safe version, 1.26.0, and rebuild affected environments from a clean base. Organizations should isolate affected hosts and CI runners, determine whether any installs occurred between 8:35 and roughly 9:20 p.m. UTC on November 17, 2026, and search proxy and DNS logs for the webhook.site exfiltration endpoint. Exposed credentials should be rotated from a clean system, and Azure identities and sign-in logs audited, along with GitHub Actions workflows that deploy to Azure. Because the stealer requested freshly issued Azure DevOps OIDC, federated, managed-identity, and GitHub Actions tokens, SafeDep's warning applies: rotating stored secrets alone does not cover tokens the platform issued to the attacker's code.

By the numbers

Source snapshot

Source snapshot
Source snapshot
Share this article