Wiz Links Microsoft Agent Framework Package Compromise to Release Pipeline Certificate

Associated Writers

Microsoft Corp.’s official Python package for its Agent Framework artificial intelligence toolkit was compromised earlier this week, as an attacker published two malicious versions to the Python Package Index (PyPI) that were engineered to steal cloud and developer credentials.

The malicious versions, 1.26.1 and 1.26.2, were uploaded on Tuesday through Microsoft’s certified publisher account, giving them the semblance of a routine update to a package that receives nearly 200,000 downloads monthly. Both versions were promptly removed from PyPI within approximately an hour; however, any users who installed them during that interval remain at risk.

Researchers at cloud security firm Wiz Inc. have discovered that the attacker obtained publishing access using a client certificate and private key related to Microsoft’s Engineering System Release Pipeline, an internal service utilized by the company to sign and publish packages. According to Wiz, access filtering on the service thwarted the attacker’s initial attempt from Amazon Web Services, but they succeeded on a second attempt originating from Microsoft-owned address space.

The method through which the attacker acquired the credentials is currently unknown. By Wednesday, Microsoft had not responded to a request for comment from BleepingComputer.

During the operation, researchers observed that the attacker’s tools were sending updates to a public webhook that also collected stolen data. This tooling identified itself as Cairn, an open-source penetration-testing framework leveraging AI technology.

The malicious payload is delivered through a .pth file integrated into both releases. This type of file is executed by Python every time it launches, which means that the credential-stealing functionality activates even if the framework itself is never imported. Moreover, both versions continued to reference the legitimate agent-framework-core 1.26.0 as a dependency, allowing the framework to function normally while the malware operated in the background.

Once executed, the malware gathers sensitive information from environment variables and other active processes, in addition to credential files for services like Azure, npm, Git, Docker, and Hugging Face. It also requests Azure managed identity tokens for twelve resources, as reported by application security company Endor Labs Inc., with the second version including requests for GitHub Actions tokens. The compromised data is subsequently compressed, encoded, and transmitted to a webhook.site address controlled by the attacker.

Researchers at malware tracking site OpenSourceMalware described the malware as a “focused credential and token stealer,” clarifying that it operates as a credential extractor rather than a remote access trojan, and does not install any persistent components on infected systems.

Wiz’s analysis indicates that the number of potential victims may be limited, as it only covered data from 50 requests stored in the attacker’s free webhook.site account. Among these, 17 represented merely three unique instances of successful data theft, while the remainder came from the attacker’s own systems and scans from sandbox and security vendors.

This incident is not the first involving an official Microsoft Python package this year. In May, Microsoft’s durabletask package was compromised following the theft of its PyPI token in an attack attributed to TeamPCP, a group also linked to the compromise of LiteLLM. Wiz reported that it has not connected the two incidents.

Individuals who installed either of the malicious versions are advised to consider their credentials compromised, with researchers recommending a rebuild from version 1.26.0 and a rotation of any secrets that the affected systems could access.

“A list of dependencies in production might show no trace of the framework, while a build runner could have installed it and been shut down before the alert arrived,” stated James Matchett, head of security at software supply chain security company Cloudsmith Ltd., in an interview with SiliconANGLE.

“If that runner had access to a deployment token, the team needs to be aware of which version it installed and what the token could access,” he added.

[gspeech type=full]

Share This Article
Leave a comment