Secure Bulletin Navigating the cyber sea with knowledge
Home > Articolo > Fake Updates to Microsoft’s Agent Framework PyPI Package Stole Azure and GitHub Secrets
Fake Updates to Microsoft’s Agent Framework PyPI Package Stole Azure and GitHub Secrets
Read Time:4 Minute, 12 Second

Attackers briefly hijacked the publishing pipeline for Microsoft’s own agent-framework Python package on November 17, 2026, pushing two tainted releases to the Python Package Index (PyPI) that quietly harvested Azure, GitHub, and build-system credentials from anyone who installed them — regardless of whether the package was ever actually used in code.

A Credential Stealer That Didn’t Need to Be Imported

Security firm Wiz traced the first malicious upload, version 1.26.1, to 20:35 UTC, with a second poisoned release, 1.26.2, following roughly half an hour later. Both were pulled from PyPI by 21:30 UTC — a response window of under an hour. Wiz identified version 1.26.0 as the last known clean release and estimated the package normally sees around 41,000 downloads a week, a figure that reflects overall package popularity rather than how many installs actually grabbed a malicious version.

What made the attack particularly sneaky is how it triggered. Both releases dropped a .pth file into Python’s site-packages directory — a type of file Python automatically processes at startup, and which can contain executable code. That meant simply having the compromised package installed in an environment was enough to run the stealer the next time any Python script executed there, whether or not that script had anything to do with Microsoft’s Agent Framework. Cyber Security News has documented this same startup-hijacking trick before, in an unrelated compromise of the elementary-data PyPI package.

The two versions used slightly different file names to disguise themselves — 1.26.1 relied on agent_framework_meta.pth paired with a collector script called _telemetry.py, while 1.26.2 restored the package’s legitimate initializer and hid its payload in af_runtime_diag.py, triggered via af_runtime_diag.pth. A defender who checked only for the first version’s file names could easily miss the second, even though both ultimately phoned home to the same destination.

A Legitimate Account, Not a Lookalike Package

Unlike many typosquatting supply-chain attacks, this one didn’t rely on a deceptively named clone package. Researchers found the malicious releases published under the legitimate, Microsoft-associated PyPI account for the real package. Wiz checked Microsoft’s own GitHub repository and found no corresponding release tag and no malicious code on the main branch — strongly suggesting the compromise happened somewhere in the publishing pipeline rather than in Microsoft’s source code itself. Adding to the suspicion, the first malicious release shipped only as a pre-built wheel, without the usual accompanying source archive or matching core-library release, hinting the attacker may have bypassed the normal build process. The exact entry point Microsoft’s publishing credentials were compromised through remains unconfirmed.

What the Malware Actually Targeted

According to an analysis from supply-chain security firm Socket, both malicious versions scoured environment variables, readable process memory, and local configuration files for secrets, specifically targeting:

  • Azure CLI session data and Azure DevOps agent credentials
  • Git credential stores
  • Docker and npm configuration files
  • Application .env files

Rather than relying solely on secrets already sitting on disk, the stealer actively attempted to request fresh Azure managed identity tokens and Azure DevOps access tokens. The second version went a step further, also requesting GitHub Actions OpenID Connect (OIDC) tokens from any workflow configured to issue them — tokens normally used to let a build job prove its identity to a cloud provider without storing a long-lived password. If an organization’s Microsoft Entra ID configuration trusted that workflow, a stolen OIDC token could potentially be exchanged for real Azure access within whatever permissions that identity held.

Both versions exfiltrated compressed, encoded data to a specific address on the free webhook-testing service webhook[.]site. Wiz noted that no more than 50 requests reached that endpoint — but cautioned this is not a reliable count of how many systems or credentials were actually exposed, since a single successful request could easily contain several valid secrets at once.

Recommended Response

Organizations that may have installed either version should search dependency lockfiles, build logs, cached Python environments, and container images for traces of 1.26.1 or 1.26.2. Any match should be treated as a compromised host or build runner — isolate it rather than running Python inside it to investigate further, since doing so could re-trigger the stealer. Security teams should also check proxy and firewall logs for connections to the specific webhook[.]site path identified in Socket’s published indicators, rebuild affected systems from known-clean images, and pin the package to version 1.26.0 going forward. Removing the malicious versions from PyPI does nothing to remove copies already cached locally or baked into existing container images.

From a verified clean system, teams should rotate or revoke any credentials that were reachable from the affected environment and review Azure sign-in and activity logs for unusual use of managed identities or service connections. Any GitHub Actions workflow that installed version 1.26.2 with id-token: write permissions should have its Entra ID trust configuration and sign-in history reviewed closely.

Share: Twitter  |  Facebook  |  LinkedIn
Join the discussion

This is a blog in the Fediverse: you can find this article everywhere with @blog@securebulletin.com and every comment/answer will appear here.

If you want to comment on Fake Updates to Microsoft’s Agent Framework PyPI Package Stole Azure and GitHub Secrets, use the discussion on Forum.

>> forum community

Comments

Leave a Reply