Mistral AI Python SDK PyPI Package v2.4.6 Backdoor
Summary
On May 12, 2026, Mistral AI published security advisory MAI-2026-002 disclosing that version 2.4.6 of the mistralai Python SDK on PyPI had been compromised during a software supply-chain attack. Mistral said the affected PyPI release was uploaded at approximately 00:05 UTC on May 12, 2026, and that the PyPI project was quarantined. A GitHub security advisory for the mistralai Python client states that no v2.4.6 tag, commit, or release workflow run exists in the repository and that the upload bypassed the normal PyPI Trusted Publishing release pipeline.
NHS England Digital separately listed mistralai==2.4.6 as an affected PyPI package in a supply-chain alert. The public Mistral and GitHub advisories remain the primary sources for package behavior and remediation, and they do not identify a confirmed actor or confirmed victim count for the mistralai==2.4.6 PyPI release.
Technical Analysis
The Mistral advisory says the malicious PyPI package ran a script at import time on Linux systems and spawned a background process to harvest credentials from common locations. The related GitHub security advisory describes a function named _run_background_task added to src/mistralai/client/__init__.py and called at module-load time. According to that advisory, the function:
- Returned immediately on non-Linux systems or when the
MISTRAL_INITenvironment variable was already set. - Set
MISTRAL_INIT=1before launching the child process. - Downloaded
https://83.142.209.194/transformers.pyzto/tmp/transformers.pyzif the file was not already present. - Spawned the downloaded file with the current Python interpreter as a detached process.
The GitHub advisory narrows one important execution condition: a bare import mistralai alone did not trigger the loader because the package is laid out as a PEP 420 namespace package, while documented SDK usage through mistralai.client.* would trigger the path. The advisory also states that pip install, pip download, and pip wheel do not invoke the dropper by themselves.
The available public record for this event scopes the incident to the Mistral PyPI release and does not attribute the activity to a named actor.
Attack Chain
- Staging — Mistral AI said current investigation indicated that an affected developer device was involved and that it had no indication Mistral infrastructure was compromised.
- Publication — Malicious release
mistralai==2.4.6was uploaded to PyPI at approximately 00:05 UTC on May 12, 2026. - Distribution — The compromised package was available through PyPI until the project was quarantined.
- Execution — On Linux hosts, SDK usage that imported through
mistralai.client.*triggered malicious code in__init__.py. - Payload delivery — The code fetched
transformers.pyzfrom83.142.209.194and launched it as a detached Python process. - Response — Mistral advised affected users to clean impacted systems and rotate secrets accessible from those systems.
Timeline
- 2026-05-12 00:05 UTC — Mistral AI says the compromised
mistralai==2.4.6package was uploaded to PyPI. - 2026-05-12 — Mistral AI published MAI-2026-002, and the associated GitHub security advisory documented the malicious dropper behavior.
- 2026-05-12 — NHS England Digital listed
mistralai==2.4.6as an affected PyPI package in a supply-chain alert.
Impact Assessment
Linux environments that imported code through mistralai.client.* from mistralai==2.4.6 during the exposure window should be treated as potentially compromised. The GitHub advisory recommends rotating every credential reachable from the importing process and reviewing host and cloud audit logs from approximately 2026-05-12 00:05 UTC onward.
Mistral AI states that current investigation indicated an affected developer device was involved and that there was no indication Mistral infrastructure was compromised. The advisory was described as under active investigation at time of publication.
For this specific PyPI event, the public advisories support treating affected Linux hosts as potentially compromised, but they do not provide a confirmed victim count or confirmed actor identity.
Attribution
The attacker is unknown. Mistral AI’s advisory does not attribute the PyPI compromise to a named group or state actor, and the GitHub advisory does not name a responsible actor for mistralai==2.4.6.
Remediation & Mitigation
Mistral AI and the GitHub security advisory recommend treating affected Linux systems conservatively. Operators should:
- Identify lockfiles, build artifacts, package caches, container images, and deployed environments that contain
mistralai==2.4.6. - Treat Linux environments that imported the affected package as potentially compromised pending forensic review.
- Rotate credentials reachable from the importing process and review host and cloud audit logs.
- Check for
/tmp/transformers.pyz,MISTRAL_INIT=1, or a detached Python process running/tmp/transformers.pyz. - Block or monitor outbound connections to
83.142.209.194. - Pin
mistralaito2.4.5or earlier until a verified clean release path is available.
Sources & References
- Mistral AI: MAI-2026-002 security advisory — Mistral AI, 2026-05-12
- GitHub / Mistral AI: Malicious dropper in mistralai 2.4.6 PyPI package — GitHub / Mistral AI, 2026-05-12
- NHS England Digital: Cyber Alert CC-4781 — NHS England Digital, 2026-05-12
- GitHub / Mistral AI: client-python issue #523 — GitHub / Mistral AI, 2026-05-12