Hackers hijacked Microsoft’s Python AI framework to spread malware by exploiting admin credentials. The malicious package steals secrets from Azure, Git, and Docker. A Microsoft spokesperson said they "have made some repositories private while investigating malicious content to protect customers." The agent-framework GitHub repository is currently offline for security reasons.

The attack was carried out by exploiting admin credentials of Microsoft's GitHub organization.

The first version, 1.26.1, was reverted to a safe version according to OX Security, but the attacker later uploaded version 1.26.2 through Microsoft's official PyPI publisher account.

This indicates that the credentials were not secured at the time of their report.

The compromised package is being used to steal environment variables, credential files, and other secrets from Azure, Git, Docker, and Hugging Face.

It doesn't even need to be imported for its malicious activities. All it requires is a Python interpreter with the package installed.

The infected package downloads the legitimate version 1.26.0 of Microsoft's agent-framework and secretly collects credentials before sending them off to a hard-coded address in the malware code.

The malware not only passively steals credentials but also actively requests and collects new ones.

It specifically calls for fresh identity tokens from GitHub Actions, Azure DevOps, and Azure itself.

These are then exfiltrated to the same hard-coded address in the malware code.

This combination of passive theft and active token requests makes it especially dangerous in cloud build environments, according to researchers at OpenSourceMalware.

As of writing, the agent-framework GitHub repository is offline. It's worth noting that Microsoft's repo for ONNX Runtime, an AI accelerator, is also offline.

However, other Microsoft repos are still available and there is no connection between the ONNX repo's pull and the malware campaign.

A Microsoft spokesperson said they have made some repositories private while investigating malicious content to protect customers and the broader ecosystem.