Microsoft Agent Framework PyPI Package Compromised with Credential-Stealing Malware

Hackers published two malicious versions of Microsoft’s official Agent Framework Python package on PyPI, versions 1.26.1 and 1.26.2, designed to steal cloud credentials and sensitive data from developers. The compromised releases executed automatically during Python startup even without importing the package, while maintaining a dependency on the legitimate agent-framework-core 1.26.0 to avoid detection. The malware harvested secrets from environment variables, configuration files, and running processes, targeting services including Azure, AWS, GitHub, Docker, Hugging Face, and OpenAI, and attempted to obtain Azure managed identity tokens and GitHub Actions OIDC tokens. Security firms Socket, Step Security, and Ox Security identified the attack, noting the use of .pth files to load malicious telemetry and diagnostic code that exfiltrated data to an attacker-controlled webhook. PyPI quickly quarantined both releases, yet the second version appeared only 2.5 minutes after the first, indicating the attacker retained publishing rights. Developers are advised to isolate affected systems, rotate exposed credentials, and rebuild environments using the clean 1.26.0 release.

BleepingComputerTranslated from English

Read at source

Hackers compromised Microsoft’s official Agent Framework Python package on PyPI, publishing two malicious versions designed to steal cloud credentials and other sensitive information from developers' systems.

Microsoft Agent Framework is Microsoft's open-source toolkit for building AI agents and coordinating them in workflows. It remains a fairly popular tool with roughly 200,000 monthly downloads on PyPI.

The malicious releases, versions 1.26.1 and 1.26.2, were published on November 17, 2026, and contained a credential stealer that executed automatically during normal Python startup in affected environments, even when the Agent Framework package was not imported. Both versions retained their dependency on the legitimate agent-framework-core 1.26.0 package, allowing the framework to function normally while the malware ran in the background.

Attack overview

Version 1.26.1 contained a credential stealer that harvested secrets from environment variables, local configuration files, and other running processes where permissions allowed, targeting Azure, AWS, GitHub, Docker, Hugging Face, OpenAI, and other services. The malware also attempted to obtain Azure managed identity access tokens and Azure DevOps OIDC tokens, potentially giving attackers access to additional cloud resources. Version 1.26.2 added GitHub Actions OIDC token requests and searches of GitHub runner directories.

According to Socket and StepSecurity, the first malicious release used agent_framework_meta.pth to execute the credential stealer in agent_framework_meta/_telemetry.py during Python startup. The second release restored the original package initializer and moved the malicious code into af_runtime_diag.pth and af_runtime_diag.py. Both versions exfiltrated collected data to the same attacker-controlled endpoint.

Collecting data from breached environments

PyPI quarantined the first malicious release, but the attacker published a second version roughly 2.5 minutes later, which was also quarantined about eight minutes afterward. The second release indicates that the attacker still had publishing access after the initial quarantine. It remains unclear how the attacker gained access to publish malicious releases under Microsoft’s official PyPI project.

Developers who installed either malicious version should isolate affected environments, avoid running Python or pip until they are secured, and rebuild from a known-clean environment using the safe 1.26.0 release. Any potentially exposed credentials that were within the reach of the compromised environment should be rotated immediately. To determine the exact level of compromise, investigators should look for the specific webhook URL path in egress logs and distinguish blocked requests from completed transfers.

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in Supply Chain & OSS

StepSecurity Raises $20 Million Series A to Strengthen Software Supply Chain Defenses
Malicious Microsoft Agent Framework Releases on PyPI Steal Cloud and CI/CD Credentials
Attackers Compromise Microsoft's agent-framework PyPI Package to Steal Cloud Credentials