Microsoft agent framework hijacked to distribute malware

⚡ TL;DR
Two releases of Microsoft’s official Python agent package on PyPI were hijacked to distribute credential-stealing malware, researchers reported. The malware can run when Python starts without the package being imported, and Microsoft says it has made some repositories private while investigating.

Microsoft’s official Python agent framework package on PyPI was hijacked to distribute information-stealing malware, multiple security research firms discovered, according to The Register’s November 18 report. Researchers identified versions 1.26.1 and 1.26.2 of the agent-framework package as affected, while Microsoft said it had made some repositories private to investigate malicious content.

agent framework

The malicious releases collect developer credentials and other secrets, and can run when a Python interpreter starts without the package being imported. Researchers also found that the malware requests fresh tokens from cloud and development services rather than limiting itself to credentials already present.

Two agent framework releases identified

The Register reported that researchers had flagged the affected versions the previous evening and that morning. According to OX Security, version 1.26.1 was reverted to a safe version, but the attacker subsequently uploaded version 1.26.2 through Microsoft’s official PyPI publisher account.

That second upload suggested that the credentials had not been locked down at the time of OX Security’s report. The Register described the incident as appearing to involve unauthorized access to an administrator account in Microsoft’s GitHub organization, rather than presenting that access route as a confirmed finding from Microsoft.

The two releases are the versions specifically identified in the reporting. The Register advised users who found either one in their environments to assume they had account security work to do.

Malware runs without a package import

The malicious package does not need to be imported for its credential theft to begin. According to The Register, starting a Python interpreter with the infected package installed is enough to activate it. That makes the startup behavior, rather than an explicit call to the package, central to the reported attack.

The infected release also pulls in the genuine 1.26.0 version of Microsoft’s agent framework to keep functioning and appear legitimate. Meanwhile, the malicious component gathers credentials and sends them as a base64-encoded chunk of JSON to a webhook.site address hard-coded into the malware.

Researchers described the malware as nonpersistent: it runs only while the malicious version remains in a site-packages directory. Its activity nevertheless includes both collecting existing secrets and actively requesting additional credentials while it is running.

Fresh tokens requested from cloud services

The information targeted includes environment variables, credential files and other secrets associated with Azure, Git, Docker, Hugging Face and other sensitive developer services, The Register reported. The collection therefore extends beyond credentials belonging to a single service.

In addition to searching the environment for existing credentials, the malware requests fresh identity tokens from GitHub Actions, Azure DevOps and Azure itself. Those newly requested tokens are sent to the same webhook destination used for the other stolen information.

“That combination of passive theft and active token requests makes it especially dangerous in cloud build environments, because even short-lived tokens are useful when they’re exfiltrated right away,” said researchers at OpenSourceMalware.

The researchers’ warning specifically addressed the combination of those two behaviors: stealing what is already available and collecting new tokens that can be sent away immediately.

Package draws nearly 200,000 monthly downloads

Microsoft’s agent framework for Python is used to build and deploy AI agents and receives nearly 200,000 downloads a month, according to The Register. That figure describes the package’s download activity, not a reported count of compromised users or systems.

The reported malicious behavior concerns versions 1.26.1 and 1.26.2, while the genuine 1.26.0 release was used by the infected package to preserve its functionality. The attack thus combined a working Microsoft package with credential-stealing activity in the background.

Microsoft makes repositories private during investigation

The report appeared during Microsoft’s annual Ignite conference, where CEO Satya Nadella was addressing investors and customers.

The agent-framework GitHub repository was offline when The Register published its report. Microsoft’s repository for ONNX Runtime, an AI accelerator, was also offline, while other Microsoft repositories remained available.

Neither Microsoft nor security researchers had linked the ONNX Runtime repository’s removal from public view to the malware campaign. Its offline status was reported separately from the findings about the infected PyPI releases.

“We have made some repositories private while we investigate malicious content,” a Microsoft spokesperson told The Register. “Our priority is to protect customers and the broader ecosystem. We are working to review and will take further action as needed.”

0
Show Comments (0) Hide Comments (0)
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x