Microsoft's agent-framework hijacked on PyPI with a credential stealer that runs on every Python start

Microsoft's agent-framework hijacked on PyPI with a credential stealer that runs on every Python start

On November 17, two malicious releases of Microsoft's agent-framework package, the Python umbrella package for its open-source AI agent framework, were pushed to the official PyPI project. Versions 1.26.1 and 1.26.2 dropped a .pth startup hook into site-packages, so the stealer ran on any Python launch in that environment (pytest, pip, IDE language servers, container entrypoints) with no import needed. It swept environment variables and credential files, requested fresh Azure managed-identity tokens and, in 1.26.2, GitHub Actions OIDC tokens, then posted everything to a webhook. The legitimate code kept working, so nothing visibly broke. PyPI quarantined 1.26.1 after about 30 minutes, but the attacker published 1.26.2 just over two minutes later, a reminder that pulling one bad version does not revoke a compromised publishing credential. If either version touched a laptop, runner, or image, rebuild from a clean base, pin to 1.26.0, and rotate every cloud, Git, registry, and LLM API secret that environment could read. More broadly, pin and lock agent dependencies, prefer packages with publish provenance, and restrict CI egress.

This is a summary by our content curator. Read the original at Socket: https://socket.dev/blog/agent-framework-pypi-package-compromised-with-credential-stealer.