Compromised `mistralai` PyPI Package Deployed Linux Credential-Stealing Malware
Supply Chain Risk · 6 sources · Updated 5mo ago · First seen May 12, 2026

Microsoft Threat Intelligence warned that version 2.4.6 of the widely used mistralai package on PyPI was compromised in a software supply-chain attack, with malicious code inserted into mistralai/client/__init__.py. The code executed on import, retrieved a second-stage payload from a remote server, and deployed malware on Linux systems. The payload was written to /tmp/transformers.pyz to resemble legitimate Hugging Face tooling, while additional components including pgmonitor.py and a persistent systemd service named pgsql-monitor.service were used to blend into developer and database-monitoring environments. Microsoft said the malware primarily targeted credentials and persistence, with the potential to expose GitHub tokens, cloud API keys, SSH keys, npm credentials, and CI/CD secrets.
Researchers said the intrusion may be tied to the broader Mini Shai-Hulud campaign, which has also been associated with compromised TanStack packages and multiple Mistral npm SDK packages, suggesting an expanding effort against developer ecosystems and trusted package repositories. The malware also contained geo-aware logic, including a destructive branch that could trigger system wiping on hosts appearing to be in Israel or Iran, while avoiding Russian-language systems. Microsoft urged defenders to isolate affected Linux hosts, block outbound connections to the malicious infrastructure, hunt for indicators including /tmp/transformers.pyz, pgmonitor.py, and pgsql-monitor.service, and rotate any credentials that may have been exposed.


