Malicious Dropper Found in mistralai PyPI Package 2.4.6
The mistralai PyPI package version 2.4.6 contains a malicious dropper that executes on import on Linux, downloading and executing a second-stage payload from a remote IP address, potentially leading to arbitrary code execution.
The mistralai PyPI package version 2.4.6 contains a malicious dropper that executes upon import on Linux systems. This malicious version was uploaded without a corresponding tag, commit, or release workflow run in the legitimate repository, and it bypassed the normal release pipeline that uses PyPI Trusted Publishing. The legitimate latest version before the malicious upload was 2.4.5. Upon import, the package attempts to download and execute a file from a remote server. The mistralai PyPI project has been quarantined as a result. This incident highlights the risk of supply chain attacks targeting software dependencies and the importance of verifying package integrity. Defenders should monitor for unexpected network connections and file creations originating from Python interpreters.
Attack Chain
- A malicious version 2.4.6 of the
mistralaipackage is uploaded to PyPI. - A user installs the malicious package using
pip install mistralai==2.4.6. - The user imports the
mistralaipackage in a Python script (e.g.,import mistralai). - The
_run_background_taskfunction insrc/mistralai/client/__init__.pyexecutes. - The function checks if the operating system is Linux and if the
MISTRAL_INITenvironment variable is set. If not, it proceeds. - The function attempts to download
https://83.142.209.194/transformers.pyzto/tmp/transformers.pyzusingcurl -k -L -s. - If the download is successful, the function executes
/tmp/transformers.pyzusing the current Python interpreter via_sub.Popen, discarding stdout and stderr. - The second-stage payload in
transformers.pyzexecutes, with the nature of its actions unknown, potentially leading to arbitrary code execution and system compromise.
Impact
Successful execution of the dropper leads to the download and execution of an unknown second-stage payload on Linux systems. The impact is potentially severe, as the attacker could gain unauthorized access to the compromised system, exfiltrate sensitive data, install malware, or perform other malicious activities. Given the popularity of machine learning libraries, a successful attack could affect a wide range of users and organizations. Any Linux environment that imported mistralai==2.4.6 should be treated as potentially compromised.
Recommendation
- Immediately pin
mistralaito version2.4.5or earlier to prevent further installations of the malicious package. - Rotate every credential reachable from any process that imported
mistralai==2.4.6as described in the advisory. - Review host and cloud audit logs for activity from approximately 2026-05-12 00:05 UTC onward, per the advisory.
- Monitor for outbound HTTPS connections to
83.142.209.194originating fromcurlprocesses, as outlined in the IOCs. - Implement a detection rule to identify the execution of
/tmp/transformers.pyzby a Python interpreter, based on the process execution information provided in the attack chain. - Block the domain
83.142.209.194at the firewall or DNS resolver based on the IOCs.
Detection coverage 2
Detect Malicious mistralai Package - Suspicious Curl Download
highDetects suspicious curl command downloading a file from a known malicious IP address related to the malicious mistralai package.
Detect Malicious mistralai Package - Python Executing Downloaded File
criticalDetects a Python interpreter executing the downloaded transformers.pyz file from /tmp, indicating potential second-stage execution.
Detection queries are available on the platform. Get full rules →
Indicators of compromise
1
hash_sha256
1
ip
1
url
| Type | Value |
|---|---|
| ip | 83.142.209.194 |
| url | https://83.142.209.194/transformers.pyz |
| hash_sha256 | 6dbaa43bf2f3c0d3cddbca74967e952da563fb974c1ef9d4ecbb2e58e41fe81b |