Malicious Microsoft AI package releases activate at Python startup
Edited and reviewed by AI Ping Editorial Team
3-line summary
- agent-framework 1.26.1 and 1.26.2 carried credential-stealing code and were quarantined on PyPI.
- Startup hooks can run without importing the framework, exposing workstation and build-environment secrets.
- Wiz reported three distinct victim-data exfiltration cases among 50 stored requests it examined.
Two malicious releases of Microsoft's Agent Framework Python package have been identified carrying a credential stealer. A GitHub security advisory published on November 18 names agent-framework 1.26.1 and 1.26.2, both uploaded to PyPI on November 17 and subsequently quarantined.
Developer computers and build environments that installed those releases are within the assessment scope even if nobody used the framework. SafeDep found that an added startup file loads the collector when Python starts, before a user builds or runs an AI agent.
The mechanism uses .pth files, normally associated with Python's package search paths. The Python Software Foundation's documentation explains that executable entries are processed during initialization, independently of whether a particular module will be used. Starting an ordinary Python tool can therefore load an installed malicious entry.
Endor Labs found the malicious additions in the umbrella package that brings together framework components. Both releases retained their dependency on the legitimate agent-framework-core 1.26.0. The remaining framework could install and function normally, leaving a working application an unreliable indication of package integrity.
The second release changed the layout. Endor found its existing initializer byte-identical to the clean 1.26.0 file, while an additional startup file loaded the collector separately. The 22 related packages it examined still had November 12 as their latest release date at that time. That observation limits the finding to the artifacts checked.
Stored secrets and newly issued identity tokens
OpenSourceMalware's analysis identifies environment variables, developer credential files and secrets held by other processes as collection targets. The scope includes cloud login material on workstations and service credentials supplied to automated builds.
The collector also requested newly issued access credentials using the environment's existing authority, including Azure managed identities, Azure DevOps and, in the second release, GitHub Actions. Microsoft's documentation explains that managed identities let applications obtain access credentials without managing passwords or keys. Authentication follows the running environment, with access determined by the services authorized for that identity.
In an update at 14:00 UTC on November 18, Wiz said it analyzed 50 stored requests at the external receiving address. It attributed 17 requests to three distinct successful victim-data exfiltration cases, separating traffic from the attacker, sandboxes, security scanning and tests. Its review covered requests stored on the receiving service's free tier.
Wiz also raised the possibility of compromised publishing-system client credentials; how those credentials were obtained remains unknown. Wiz based that assessment on operational progress messages the attacker's tooling sent to the same receiving address.
SafeDep says installations of the two malicious releases remain unknown. Project-wide download statistics do not establish how many systems received the malicious versions.
SafeDep recommended assessing reachable secrets as exposed and checking build records and caches. Its guidance calls for locking the whole dependency tree with hashes, because pinning an umbrella package can still permit newer component releases.
At the November 18 check at 19:03 UTC, PyPI's public metadata listed 1.26.0 as the latest release, with both an installation wheel and a source archive uploaded on November 12. The release map contained no file entries for 1.26.1 or 1.26.2. GitHub's malware advisory identifies those two affected versions and lists no newly patched release.
Sources
- Malicious code in agent-framework (PyPI), GHSA-764m-3ppc-5m73 — OpenSSF / GitHub Advisory Database
- Microsoft agent-framework Compromised Twice on PyPI — SafeDep
- site — Site-specific configuration hook — Python Software Foundation
- agent-framework compromised: Python startup hooks steal Azure and CI credentials — Endor Labs
- Official Microsoft agent-framework PyPI package compromised — OpenSourceMalware
- Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines — November 18 update — Wiz
- agent-framework public release metadata — Python Package Index
- Managed identities for Azure resources — credential-free token acquisition and authorization — Microsoft