mistralai
Are you affected?
mistralai to version 2.4.6 between May 12, 2026 at 00:05 UTC and the time PyPI quarantined the release. Builds pinned to 2.4.5 or earlier were never exposed.Run this from your project root to confirm:
What happened
On May 12, 2026 at approximately 00:05 UTC, an attacker uploaded mistralai 2.4.6 to PyPI. Mistral AI never released that version. The malicious release came through the project's official publish path, consistent with a compromised maintainer credential or token rather than a typosquat. The activity is being tracked as part of the "Mini Shai-Hulud" campaign (attributed to a threat actor called TeamPCP) alongside contemporaneous compromises of TanStack, UiPath, OpenSearch, and Guardrails AI packages.
The package modified mistralai/client/__init__.py, the first file that runs when a developer imports the library. The injected code uses curl with TLS verification disabled to fetch hxxps://83[.]142[.]209[.]194/transformers.pyz, saves it to /tmp/transformers.pyz, and launches it as a background Python process with stdout and stderr silenced. The filename transformers.pyz was deliberately chosen to mimic the widely-used Hugging Face Transformers library and blend into ML and developer environments.
The second-stage payload is a credential stealer that harvests secrets and access tokens from the host. It installs persistence as pgsql-monitor.service with a helper file named pgmonitor.py, both designed to look like PostgreSQL monitoring tooling. Two notable evasion features: country-aware logic that aborts execution in Russian-language environments, and a geofenced destructive branch with a 1-in-6 probability of running rm -rf / when the host appears to be in Israel or Iran.
Timeline
mistralai 2.4.6 uploaded to PyPI through compromised publish credentials.mistralai 2.4.6.If you were exposed
If pip show mistralai reports version 2.4.6, treat the host as potentially compromised. The destructive branch may have triggered on Linux systems geolocated to Israel or Iran. Microsoft's recommended mitigations:
- Isolate the affected Linux host from your network.
- Block outbound connections to
83.142.209.194. - Hunt for
/tmp/transformers.pyz,pgmonitor.py, andpgsql-monitor.service. Remove if found and review related logs. - Rotate any credentials present on the host: cloud, GitHub, CI/CD, SSH, and API tokens.
- Pin
mistralaito2.4.5or earlier in your requirements file. Clear__pycache__and any cached wheels, then reinstall from a clean lockfile.