Agent Framework Compromised: 2 Malicious Versions Steal Cloud Credentials

Agent Framework - Agent Framework Compromised: 2 Malicious Versions Steal Cloud Credentials

Microsoft’s Agent Framework Compromised: A Critical Supply Chain Vulnerability

Microsoft’s official Agent Framework Python package on the Python Package Index (PyPI) has been compromised, with attackers publishing two malicious versions designed to pilfer cloud credentials and other sensitive data from developer systems. The Agent Framework, a popular open-source toolkit used for building and coordinating AI agents, sees approximately 200,000 monthly downloads, making this supply chain attack a significant threat to the developer community.

The compromised versions, 1.26.1 and 1.26.2, were released on November 17, 2026. These malicious releases contained a sophisticated credential stealer that executed automatically during Python startup, even if the Agent Framework package itself was not explicitly imported. This stealthy execution method allowed the malware to operate in the background, posing a persistent risk to affected systems.

Malicious Architecture and Credential Exfiltration

Both malicious versions maintained their dependency on the legitimate agent-framework-core 1.26.0 package, ensuring that the Agent Framework could still function as expected. This allowed the malware to remain undetected while actively harvesting sensitive information. Version 1.26.1 was equipped with a credential stealer that targeted secrets from environment variables, local configuration files, and other running processes.

The primary targets for data exfiltration included credentials for major cloud and development platforms such as Azure, AWS, GitHub, Docker, Hugging Face, OpenAI, and others. The malware also specifically attempted to acquire Azure managed identity access tokens and Azure DevOps OIDC tokens. Gaining these tokens could grant attackers extensive access to cloud resources and sensitive project data.

Enhanced Malice in Version 1.26.2

Version 1.26.2 escalated the attack by incorporating requests for GitHub Actions OIDC tokens. Additionally, it expanded its search parameters to include GitHub runner directories, aiming to uncover further secrets and access tokens. According to security researchers from Socket and StepSecurity, the initial malicious payload in version 1.26.1 utilized `agent_framework_meta.pth` to execute the credential stealer via `agent_framework_meta/_telemetry.py`.

The subsequent release, version 1.26.2, restored the original package initializer but relocated the malicious code to `af_runtime_diag.pth` and `af_runtime_diag.py`. Regardless of the specific file structure, both malicious versions exfiltrated all collected data to a single attacker-controlled endpoint: `https://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb`.

PyPI Response and Ongoing Investigation

The PyPI security team acted swiftly to quarantine the first malicious release. However, the attacker managed to publish a second malicious version approximately 2.5 minutes later. This second release was also quarantined about eight minutes after its publication, indicating the attacker’s persistent access and ability to re-upload compromised code even after initial detection.

The exact method by which the attacker gained the ability to publish malicious releases under Microsoft’s official PyPI project remains unclear. This incident underscores the critical importance of robust security measures within software repositories and the ongoing challenges of securing the software supply chain. Such attacks can have far-reaching consequences, impacting not only individual developers but entire organizations relying on these tools.

Mitigation and Developer Best Practices

Developers who may have installed either of the malicious Agent Framework versions are strongly advised to take immediate action. It is crucial to isolate affected environments and refrain from running Python or pip until the systems are secured. Rebuilding development environments from a known-clean state, using the safe 1.26.0 release, is the recommended course of action.

Furthermore, any credentials that might have been accessible within the compromised environment should be rotated immediately. This includes API keys, cloud access tokens, and any other sensitive authentication information. To ascertain the full extent of the compromise, security investigators should scrutinize egress logs for the specific webhook URL path, distinguishing between blocked requests and successful data transfers.

This incident serves as a stark reminder of the evolving threat landscape in software development. As AI and automation become more integrated into development workflows, as seen with tools like the Agent Framework and advancements in areas like Edge AI for smarter field intelligence, the security of the underlying libraries and packages becomes paramount. Vigilance and proactive security measures are essential to protect against sophisticated supply chain attacks.

Source: BleepingComputer Security