BehindLines

Microsoft's Python AI agent package hijacked on PyPI

· BehindLines newsroom

Two booby-trapped releases of Microsoft's Agent Framework, a toolkit for building artificial intelligence agents, were put on PyPI, the public repository for Python software. According to BleepingComputer and The Register, they were used to steal developers' credentials. The software gets about 200,000 downloads a month.

What the trapped versions did

According to BleepingComputer, the releases numbered 1.26.1 and 1.26.2 went online on November 17. Their malicious code ran as soon as Python started, even when the package was not imported. The package kept a dependency on the legitimate 1.26.0 release, which let it work normally while the theft went on, The Register specifies. The spyware gathered environment variables and configuration files tied to services such as OpenAI, Hugging Face, Docker, GitHub, AWS and Azure. It also requested new access tokens: Azure and Azure DevOps in the first version, then GitHub Actions in the second. The data went to an address controlled by the attacker. Researchers from OpenSourceMalware, cited by The Register, consider this combination particularly dangerous in cloud build environments, since even tokens with a short lifetime serve a purpose if they are exfiltrated immediately.

A breach still unexplained

Several security firms documented the attack, including Socket, StepSecurity and OX Security, according to BleepingComputer. PyPI quarantined the first version, but the attacker published a second one about two and a half minutes later, which, according to BleepingComputer, indicates that the attacker kept publishing access. BleepingComputer writes that the origin of the compromise remains unknown and that Microsoft had not replied. The Register mentions unauthorized access to an administrator account of Microsoft's GitHub organization, speaking of an appearance and not a certainty. The Agent Framework repository is offline; that of ONNX Runtime is too, with no established link to the attack, according to the outlet.

Microsoft's reaction

A company spokesperson told The Register that some repositories had been made private while it investigates malicious content, and that Microsoft was reviewing the situation to take further action if needed.

Why it matters

The case involves an official package from a major vendor, put online from Microsoft's PyPI publishing account, according to The Register. The sources consulted do not give the real extent of the thefts.

Sources