An attacker slipped password-stealing code into Microsoft's Agent Framework, a package of ready-made code that programmers download to build AI agents. AI agents are AI that can carry out tasks on its own, such as using apps and websites, instead of only answering questions. Two tampered versions, numbered 1.26.1 and 1.26.2, were posted on Nov. 17 to PyPI, the main public site where programmers download Python code. GitHub's security advisory says the first went up at 20:35 UTC and the second at 21:08 UTC, and both have since been removed. Wiz, a security company that studied the attack and reported its findings to Microsoft on Nov. 17, says both were gone by 21:30 UTC and that the package is downloaded about 41,000 times a week.
GitHub's advisory says each tampered version added a small startup file that Python runs every time it starts, so the hidden code ran as soon as the package was installed, even if no one used it. The code searched the computer for passwords and access keys, including ones for Microsoft's Azure cloud, Amazon's cloud, GitHub, OpenAI and Hugging Face, and for saved login files. Wiz says it was aimed mainly at Azure, and that it also asked Azure's servers for fresh access passes. It sent what it found to a web address the attacker had set up on a free public service. The second version also tried to take the short-lived login passes used by GitHub Actions, the service many teams use to build and test their software automatically.
According to Wiz, the attacker appears to have gotten hold of a certificate and private key, a pair of digital credentials, for the internal service Microsoft uses to publish the package and stamp it as genuine. A first attempt to publish from Amazon's cloud was blocked because the service accepts only certain internet addresses, and a second one from internet addresses owned by Microsoft went through. The attacker's tools identify themselves as Cairn, a publicly available AI tool built to test how well systems hold up against hackers. Before publishing, the attacker tried the stealing code on their own computer, where it picked up the settings of an AI coding helper.
Wiz says the attacker used a free address, not tied to any account, on a public service that takes only a limited number of messages and turns away anything past that without recording it, and that at most 50 were captured. Wiz says it read all 50. Of those, four came from the attacker, 29 appear to have come from test machines and security scanners, and 17 came from three real cases in which victims' data was taken. Wiz says those messages can hold working passwords and keys for cloud and build systems. The service's own help pages say data at a free address can be read by anyone who knows the address, and that it is deleted after seven days.
GitHub's advisory says anyone who installed version 1.26.1 or 1.26.2 should assume that computer or build server is exposed and change every password and key it could reach, including those for automated build systems; versions 1.26.0 and earlier are not affected. Wiz says how the attacker got Microsoft's publishing credentials is not yet known, and the advisory does not tie the attack to any known hacking campaign. Microsoft had not published its own account of the attack by Nov. 20.