Microsoft's agent-framework PyPI package was compromised and implanted with credential-stealing code
Microsoft’s agent-framework PyPI package Compromised with Credential Stealer
Microsoft's agent-framework PyPI package was compromised on November 17, with credential-stealing code implanted in versions 1.26.1 and 1.26.2. The malicious code uses a .pth startup hook to collect credential-related environment variables, local configuration and credential files, and the environments of other processes at Python startup in a background process or thread, and actively requests cloud identity tokens such as Azure managed identity tokens; 1.26.2 additionally adds GitHub Actions OIDC token requests. The data is compressed and Base64-encoded, then exfiltrated to the same webhook.site endpoint. 1.26.2 restores the legitimate package initialization file byte for byte, so checking only that file would miss this version. Socket recommends avoiding installation of these two versions; those who have installed them should remove them and rotate potentially leaked credentials. The article includes SHA256 values for the relevant files.
The article provides affected versions, the startup hook mechanism, SHA256 and other indicators for investigation, so teams using agent-framework can check their environments and rotate credentials accordingly.