Hackers compromised Microsoft’s official open-source Agent Framework Python package on PyPI by publishing two malicious releases designed to steal cloud credentials and sensitive information. The supply chain attack involved versions 1.26.1 and 1.26.2 of the package, which is an open-source toolkit used for building AI agents and coordinating workflows with roughly 200,000 monthly downloads on PyPI. Security firms Socket, Step Security, and Ox Security discovered and documented the attack, prompting PyPI to quarantine the malicious packages shortly after publication.
The Microsoft Agent Framework package is typically utilized by developers creating sophisticated artificial intelligence workflows and automated agents. Because open-source repositories rely heavily on trusted maintainer accounts and automated publishing pipelines, supply chain compromises targeting major software vendors pose significant risks to downstream users. In this incident, the attackers managed to push unauthorized versions directly under Microsoft’s official PyPI project, although the exact entry point or breach method allowing them to publish remains unclear.
The malicious versions contained a credential stealer that executed automatically during normal Python startup, even when the package was not explicitly imported by the user. Both versions maintained a dependency on the legitimate agent-framework-core 1.26.0 package so that the framework functioned normally while malware ran quietly in the background. Version 1.26.1 harvested secrets from environment variables, local configuration files, and running processes targeting Azure, AWS, GitHub, Docker, Hugging Face, OpenAI, and other services, along with Azure managed identity access tokens and Azure DevOps OIDC tokens. Version 1.26.2 added GitHub Actions OIDC token requests and searches of GitHub runner directories.
Technical analysis revealed that Version 1.26.1 used agent_framework_meta.pth to execute the stealer in agent_framework_meta/_telemetry.py during Python startup. Version 1.26.2 subsequently restored the original initializer and moved the malicious code into af_runtime_diag.pth and af_runtime_diag.py. Both versions exfiltrated harvested data to the same webhook endpoint located at https://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb. PyPI quarantined the first release quickly, but the attacker managed to publish version 1.26.2 roughly 2.5 minutes later, which was then quarantined about eight minutes afterward.
The impact of this compromise affects any development environments or automated pipelines that automatically pulled or updated to the malicious versions 1.26.1 and 1.26.2. Because the payload executed instantly upon Python startup and targeted a wide array of cloud provider tokens, development secrets, and CI/CD credentials, organizations that ingested the packages face severe risks of unauthorized access to cloud resources, code repositories, and integrated artificial intelligence platforms.
Developers who installed either malicious version should immediately isolate affected environments, avoid running Python or pip until secured, and rebuild from a known-clean environment using the safe 1.26.0 release. Any potentially exposed credentials within reach of the compromised environment must be rotated without delay, and investigators should check egress logs for the specified webhook URL path to determine the exact level of compromise. This incident underscores the ongoing vulnerabilities within software supply chains and open-source package repositories.
Stay alert, and keep your security measures updated!
Source: Follow cybersecurity88 on X and LinkedIn for the latest cybersecurity news