Skip to content
Back to articles
security3 min

PyPI: Mistral AI SDK and guardrails-ai published with malware (May 2026)

KGA IT
2026-10-123 min
SecuritySupply chainPyPIMistral AIGuardrails AIMaio 2026

What happened

In May 2026, two popular Python packages in the AI world were published to PyPI with malicious code:

  • guardrails-ai 0.10.1, on May 11 (around 6 PM Pacific). Researchers flagged it within about 2 hours and PyPI quarantined it. It was assigned CVE-2026-45758 (CVSS 9.6).
  • mistralai 2.4.6, Mistral AI's official Python SDK, available from May 12 (00:05 UTC), according to advisory GHSA-wx9m-wx4f-4cmg. The package has 716 dependents.

Both are supply-chain attacks: the project's legitimate code on GitHub wasn't changed, but someone pushed a tampered release to PyPI.

What the malicious code did

  • mistralai 2.4.6: on Linux, simply running import mistralai made the code download a second stage (transformers.pyz) from a hardcoded IP, with TLS verification off and all output suppressed, and run it in the background. According to the advisory, the upload bypassed PyPI Trusted Publishing and had no matching GitHub tag. The analysis ties it to the "mini-shai-hulud" campaign.
  • guardrails-ai 0.10.1: the code ran on install or import and allowed arbitrary code execution on the host. The maintainers say they saw no exfiltration through their systems, but recommend treating the machine's credentials as exposed.

What to do

  1. Check whether any environment (dev machine, CI/CD, server, notebook) installed mistralai 2.4.6 or guardrails-ai 0.10.1.
  2. mistralai: pin 2.4.5 or install from the verified tag. Look for /tmp/transformers.pyz.
  3. guardrails-ai: upgrade to 0.10.2 or downgrade to 0.10.0.
  4. On affected machines, rotate every reachable credential: GitHub tokens, cloud keys, package registry tokens and LLM API keys. Also check GitHub for unexpected workflows or repositories.
  5. Going forward, pin versions (hashed lockfiles) and avoid unpinned pip install in pipelines.

Why it matters

AI projects concentrate API keys, cloud credentials and training data. A single compromised import in a CI pipeline can hand all of that to an attacker.

Sources


Want to review the supply-chain security of your AI projects? KGA IT offers a free consultation: kga-it.com.

Let's solve your technical challenges together.

KGA IT Solutions delivers AI, cloud, and DevOps expertise to address your specific challenges.

Contact Us