← News
/DISPATCH · 2026-07-26

PyPI quantum library mrmustard supply-chain attack: 0.7.4 ships a credential-stealing trojan

Attackers hijacked a Xanadu mrmustard maintainer GitHub account and published a malicious 0.7.4 on PyPI. On import it steals SSH keys, AWS credentials, and Kubernetes configs, then persists via cron, shell rc hooks, and a .pth file.

Incident overview

On 23–24 July 2026, the quantum computing library mrmustard on the Python Package Index (PyPI) was hit by a serious supply-chain attack. Attackers compromised a project maintainer GitHub account and published a trojanized 0.7.4 to PyPI. The malicious release runs on import, steals SSH keys, AWS credentials, Kubernetes configs, and other secrets, then plants persistence via cron, shell startup files, and Python `.pth` files.

GitHub user Ilyas Makari first reported it in XanaduAI/MrMustard issue #656. SafeDep, OSV (Open Source Vulnerabilities), and Gridinsoft later confirmed it and tracked it as MAL-2026-11049.

Technical details

Attack path

Persistence analysis

Per SafeDep, the payload plants these paths:

| Path/file | Role | | --- | --- | | `~/.cache/.tf_cache/hw_probe.pyc` | compiled persistence stealer | | `~/.cache/.tf_cache/` | working dir for .lock_* and .ts_* state files | | `mmcompat.pth` | in site-packages; auto-loaded on Python startup | | cron (every 15 min) | `*/15 * * * * /usr/bin/env python3 .../hw_probe.pyc` | | shell rc hooks | inserts a tensorflow hardware compatibility check marked block into `.bashrc`/`.zshrc` |

Target environment

Payload is tuned for research and HPC:

On shared HPC login nodes, `mmcompat.pth` in a shared site-packages directory means any user who starts Python triggers the malware; blast radius exceeds a single user.

Impact

mrmustard is Xanadu's differentiable quantum-optics simulator, widely used in quantum computing research and photonic circuit simulation. Impact includes:

Remediation

Emergency response (if 0.7.4 was installed)

SafeDep: uninstalling mrmustard is not enough. If any machine imported mrmustard@0.7.4 or has the persistence files above, clean as follows:

Preventive measures

Sources