Microsoft’s Agent Framework PyPI Package Hacked to Steal Azure and GitHub Credentials

Blog WriterCybersecurity News - Original News Source is cybersecuritynews.com


Hackers published two malicious versions of Microsoft’s agent-framework package on the Python Package Index (PyPI) on November 17, 2026.

Versions 1.26.1 and 1.26.2 contained a credential stealer that could run during normal Python startup, even if an application never imported Agent Framework. The malware targeted Azure identities, GitHub credentials, and secrets used in automated builds.

Wiz traced the first upload to 20:35 UTC and the second to about 21:08 UTC. Both versions were no longer available on PyPI by 21:30 UTC. Wiz identified 1.26.0 as the latest known clean release and put normal package traffic at about 41,000 downloads per week. It indicates the package’s overall use, not downloads of the malicious versions or the number of victims.

Microsoft’s Agent Framework PyPI Compromised

Both releases placed a .pth file in site-packages, the directory where Python stores installed libraries. Python processes these files during normal startup and can run executable lines in them.

That meant an unrelated Python script could trigger the stealer simply by running in the affected environment. Cyber Security News documented a similar startup mechanism in its coverage of the elementary-data PyPI compromise.

The two versions left different files behind. Version 1.26.1 used agent_framework_meta.pth and a collector named _telemetry.py. Version 1.26.2 restored the package’s original initializer and moved the malicious code into af_runtime_diag.py, triggered by af_runtime_diag.pth.

A check limited to the first release’s files could therefore miss the second, even though both ran in the background and sent data to the same destination.

Researchers found the malicious releases under the legitimate Microsoft-associated PyPI publisher, not under a lookalike name. Wiz found no matching python-1.26.1 tag or release in Microsoft’s GitHub repository and no malicious code on its main branch.

The first malicious release also appeared only as a wheel, a ready-to-install Python package, rather than alongside a source archive and a matching agent-framework-core release. Those differences suggest it may have bypassed the usual build process, but the entry point remains unconfirmed

Azure and GitHub Actions Credentials

Socket’s analysis found that both versions searched environment variables, readable process data and local files for secrets. Targets included Azure CLI data, Azure DevOps agent credentials, Git credential stores, Docker and npm configuration, and application .env files. The stealer also tried to obtain fresh Azure managed identity and Azure DevOps tokens instead of relying only on credentials already stored on the system.

Version 1.26.2 added requests for GitHub Actions OpenID Connect (OIDC) tokens in workflows that could issue them. OIDC lets a build job prove its identity without storing a cloud password.

If Microsoft Entra ID trusts that workflow, a stolen token could be exchanged for Azure access within the permissions granted to that identity. An earlier Microsoft durabletask supply chain incident also targeted build and cloud credentials, but Wiz has not linked the two attacks.

Both versions sent compressed, encoded data to a specific webhook[.]site address. Wiz said the destination used the service’s free tier and that no more than 50 requests were captured. That is not a count of affected systems or exposed credentials. A single accepted request could contain several working secrets, including cloud tokens and package registry credentials.

Search dependency lockfiles, build logs, Python environments, container images, and package caches for either version. If you find one, isolate the affected host or runner and avoid starting Python in that environment to inspect it.

Check proxy logs for the specific webhook path listed in Socket’s indicators. Then rebuild from a known-good image or dependency set and pin agent-framework to 1.26.0. Removal from PyPI does not remove copies already installed or cached.

From a clean system, revoke or rotate credentials that were available to the affected environment. Review Azure sign-in and activity logs for unexpected use of managed identities and service connections.

For GitHub Actions jobs that installed 1.26.2 with id-token: write, check the Entra ID trust settings and sign-ins for the linked application.

What Are Leading Organizations Doing About AI and Cyber Risks? Find Out. View Details!

The post Microsoft’s Agent Framework PyPI Package Hacked to Steal Azure and GitHub Credentials appeared first on Cyber Security News.