N環球 N GLOBE
US Technology

Microsoft AI agent framework hit by supply-chain attack stealing cloud credentials

· N GLOBE

Microsoft's agent-framework package on PyPI was compromised on November 17: malicious versions 1.26.1 and 1.26.2 planted a credential stealer that runs on every Python start via a .pth startup hook, harvesting Azure, GitHub and other cloud credentials; PyPI pulled both versions after about 45 minutes.

Microsoft's AI agent development framework, agent-framework, was hit by a supply-chain attack on Python package repository PyPI on November 17: malicious version 1.26.1 appeared at 20:35 UTC, followed by 1.26.2 at 21:08 UTC, and PyPI quarantined both about 45 minutes later. The malicious releases planted a credential stealer that threatens every development environment that installed them during the exposure window.

Runs on every Python start, no import needed

The attack hinges on a .pth startup hook file (agent_framework_meta.pth in 1.26.1, af_runtime_diag.pth in 1.26.2). The Python interpreter executes import lines in .pth files on every start, so the stealer runs whenever Python runs — even if the code never imports agent-framework. Security firms Wiz, JFrog, Orca and Chainguard each independently analysed and confirmed the attack.

Stealer aimed squarely at cloud identity

The stealer targets the credentials AI developers use most: environment variables containing strings such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB and OPENAI, the environments of up to 300 other processes, and credential files including Azure CLI state, .npmrc, pip.conf, .netrc, .git-credentials, Docker config, Hugging Face tokens and .env files. It also actively requests Azure managed-identity tokens covering 12 Azure resources, plus OIDC identity tokens for Azure DevOps and GitHub Actions. Stolen data was zlib-compressed, base64-encoded and posted as JSON to a webhook.site address.

Researchers differ on how it got in

Researchers disagree on how the malicious versions were published. Wiz says the attacker appears to have compromised a client certificate and private key for Microsoft's Engineering System Release Pipeline (ESRP); JFrog's forensic analysis found the malicious wheel was repacked locally by the attacker (timestamps on a UTC+8 clock, user id 1000), not produced by Microsoft's release pipeline. Both agree it was a compromise of publishing credentials, not a typosquatting attack, and the source code on GitHub was not reported as modified. The tooling identifies itself as "Cairn", an open-source AI penetration-testing framework, and staged the package at /tmp/cairn_pkg on victim hosts.

Scale and what to do

Agent-framework sees about 190,000 downloads a month, or roughly 40,000 a week. JFrog notes that automated dependency bots such as Renovate were already opening upgrade pull requests in downstream repositories within six minutes of 1.26.1 landing; Chainguard blocked 1.26.1 48 seconds after publication. The last clean version is 1.26.0, published November 12. PyPI has quarantined the malicious versions and no CVE has been assigned yet. Wiz reported the findings to Microsoft on November 17. Security firms advise checking lockfiles for 1.26.1 or 1.26.2; on any host that installed either, assume credentials are compromised, isolate the host, remove the .pth and payload files, and rotate every credential it could reach.

(File photo: programming illustration.)

💬 Comments

No comments yet. Be the first!