Malicious Releases Of Agent-framework PyPI Package Developed By Microsoft. Disabling ONNX Runtime Git Repository

The attackers managed to publish malicious versions of agent-framework 1.26.1 and 1.26.2 in the PyPI repository, tools developed by Microsoft for developing AI agents in Python. These releases contained malicious code that searched for and sent credentials, tokens, and keys for connecting to cloud services and continuous integration systems. The Git repository agent-framework on GitHub is currently disabled. Also, for unknown reasons, the git repository of the more popular Microsoft project ONNX Runtime has been disabled, the PyPI package of which has 140 million downloads per month.

Built into the package agent-framework malicious code is activated by installing the files agent_framework_meta.pth (in version 1.26.1) and af_runtime_diag.py (in version 1.26.2) in the directory with the Python libraries. Installing problematic releases
1.26.1 and 1.26.2 should be considered a compromise of the system, since the substituted pth files are automatically executed every time Python is executed on the system, even if the agent-framework package is not used in the running Python code.

Once activated, the malicious code starts a background process to search for sensitive data, suppressing errors so as not to disrupt the main application. The collected information is sent to the webhook.site host via a POST request with the User-Agent “runtime-diagnostics/1” or “af-runtime-diagnostics/1”. The following data is sent: the contents of environment variables, JSON files from the ~/.azure/ directory, files that could potentially contain credentials (for example, “.credentials” and “.git-credentials”) and environment variables (“.env”), tokens and access keys to cloud providers, storage and AI services, files with pip settings (pip.conf), docker (config.json) and npm (.netrc), tokens for GitHub Actions and Azure DevOps. The malicious insert is self-sufficient, does not download additional code from external servers and does not accept commands from the control server.

As for the ONNX Runtime project, the last days of new versions in PyPI have not been published and it is unclear whether the shutdown of the ONNX Runtime repository is related to an attack on the agent-framework. Representatives of Microsoft have not yet commented on the incidents, but it is possible that a developer was compromised, who had access not only to the agent-framework, but also to the ONNX Runtime repository.

/Reports, release notes, official announcements.