A new wave of software supply-chain compromises has hit developer ecosystems used by AI and JavaScript teams, with affected packages tied to Mistral AI, TanStack and other npm namespaces.
The practical risk is not limited to a bad dependency in an application build. The more serious concern is where these packages run: developer laptops, CI runners, release workflows, internal build systems and cloud-connected automation. Those environments often hold GitHub tokens, npm publishing credentials, cloud keys, Kubernetes tokens, SSH credentials and deployment secrets.
Mistral has published an advisory confirming that Mistral SDK packages were affected by a supply-chain attack related to the TanStack incident. The company said its current investigation points to an affected developer device and that it has no indication Mistral infrastructure itself was compromised.
The Mistral advisory also separates the npm and PyPI impact. The compromised npm packages were removed from the registry and were available between May 11 at 22:45 UTC and May 12 at 01:53 UTC. Mistral said those npm packages were inoffensive because their setup script referenced a missing file. The PyPI package was more serious: mistralai==2.4.6 ran malicious code on import on Linux systems.
What Happened
The incident appears to be part of a broader Mini Shai-Hulud supply-chain campaign affecting npm packages across several namespaces. Security researchers tracking the wave reported hundreds of malicious package-version entries across more than 160 package names, including packages under @tanstack, @mistralai, @uipath, @squawk and others.
TanStack was one of the most visible affected ecosystems because its packages are widely used in modern React and JavaScript applications. Reported affected TanStack packages included routing and start-framework components such as @tanstack/react-router, @tanstack/router-core, @tanstack/history and related packages.
Mistral’s affected package list included three npm SDK packages and one PyPI release. The PyPI case is the one that should get immediate attention from Python and AI development teams because execution happened when the package was imported, not only during installation.
| Ecosystem | Package | Affected versions | Practical concern |
|---|---|---|---|
| PyPI | mistralai |
2.4.6 |
Malicious code ran on import on Linux systems |
| npm | @mistralai/mistralai |
2.2.2, 2.2.3, 2.2.4 |
Removed from registry; Mistral says referenced payload was missing |
| npm | @mistralai/mistralai-azure |
1.7.1, 1.7.2, 1.7.3 |
Removed from registry; check lockfiles and caches |
| npm | @mistralai/mistralai-gcp |
1.7.1, 1.7.2, 1.7.3 |
Removed from registry; check lockfiles and caches |
YubiKey 5C NFC security key
After rotating tokens, teams should also review how developer, GitHub, cloud and package-registry accounts are protected. A hardware security key can add phishing-resistant MFA for high-value accounts that could otherwise be abused after a supply-chain compromise.
As an Amazon Associate I earn from qualifying purchases.
For engineering leaders and security buyers, this is the part that matters: the blast radius depends less on whether an app shipped the package to production and more on whether a machine with useful credentials installed or imported it.
The PyPI Mistral Package Is the Highest-Priority Check
The compromised PyPI release mistralai==2.4.6 is the clearest immediate risk for teams using Mistral from Python. Mistral says the malicious code was injected into src/mistralai/client/__init__.py and ran at import time on Linux only.
The code downloaded a file named transformers.pyz to /tmp/transformers.pyz and executed it as a detached background process. The filename is notable because it resembles the widely used Transformers ecosystem in machine-learning environments, which could make it look less suspicious during a quick review.
Reported indicators for the PyPI case include:
mistralai==2.4.6in dependency files, lockfiles, package caches, mirrors, container layers or deployment images/tmp/transformers.pyzon Linux hosts- A process launched as
python /tmp/transformers.pyz - The environment variable
MISTRAL_INIT=1 - Outbound connections to the payload host identified in the advisory
Teams should check more than the current virtual environment. Build caches, base images, notebooks, temporary CI environments and internal package mirrors can preserve compromised packages after a public registry removes them.
That is especially important in AI development environments, where notebooks, agents, workers and experiment runners may import SDKs automatically as part of startup code.
Why CI/CD and Cloud Credentials Are at Risk
Mini Shai-Hulud-style attacks are dangerous because they target the places where software is built and released. A compromised dependency installed during a build can run in an environment with access to source repositories, signing systems, package registries, cloud deployment credentials and internal services.
Security teams should assume that an affected install environment may have exposed every secret available to that process. That includes environment variables, local credential files, package manager tokens, CI secrets mounted into jobs and service account tokens available inside runners.
The npm side of the campaign also raised concern because researchers described payload behavior built around release infrastructure, trusted publishing paths and GitHub Actions workflows. In some reports, malicious versions were associated with legitimate publishing pipelines, which means teams cannot treat provenance metadata alone as proof that a package is clean.
That does not mean every affected package produced the same outcome. Mistral’s own advisory says its compromised npm packages referenced a missing file and were inoffensive in that specific respect. But buyers evaluating software supply-chain security tools should notice the larger pattern: the attack surface is the build system, not only the application runtime.
YubiHSM 2 hardware security module
For teams protecting signing keys or internal PKI material, hardware-backed key storage can reduce the risk of private keys being copied from a compromised build host. It belongs in a broader CI/CD hardening plan alongside scoped tokens, egress controls and audit logging.
As an Amazon Associate I earn from qualifying purchases.
What Developers Should Check First
Start with the environments that had the most access. A local development laptop with a GitHub token and cloud CLI profile can be more sensitive than a locked-down production container. A CI runner with publish permissions can be more valuable to an attacker than a staging application server.
For Python projects, search dependency files and lockfiles for mistralai==2.4.6. That includes requirements.txt, pyproject.toml, uv.lock, poetry.lock, Pipfile and Pipfile.lock. Also inspect package caches, private mirrors and container images built during the exposure window.
For JavaScript projects, inspect package-lock.json, pnpm-lock.yaml and yarn.lock for affected Mistral and TanStack versions. Do not rely only on the current package tree; many organizations have build artifacts and image layers that were produced while compromised versions were available.
A practical response sequence looks like this:
- Identify affected installs in developer machines, CI jobs, package caches, private mirrors and container images.
- Remove affected package versions and pin to known-good releases.
- Isolate Linux hosts that imported
mistralai==2.4.6until they are reviewed. - Search for known payload files, unexpected background processes and suspicious outbound activity.
- Rotate all credentials available to affected machines or runners.
- Audit recent npm, PyPI, GitHub, container registry and cloud activity for unexpected publishes, workflow runs or deployments.
- Rebuild deployment images from clean dependency sources after lockfiles are corrected.
Credential rotation should not stop at the obvious package-manager token. Review GitHub personal access tokens, GitHub Actions secrets, npm tokens, PyPI tokens, cloud keys, Kubernetes credentials, SSH keys, Vault tokens and deployment credentials. If the affected environment could read it, treat it as potentially exposed.
What Security Buyers Should Take From This
This incident is a useful test case for software supply-chain defenses because it crosses the boundaries that many organizations still handle separately: open-source dependency risk, endpoint security, CI/CD hardening, secret management and cloud audit logging.
A software composition analysis tool that only reports known CVEs may miss malicious package behavior during the first hours of an attack. Endpoint tools that ignore developer package managers may miss the initial install. CI systems without egress controls may allow a payload to download a second stage or send credentials out. Secret scanners can help after the fact, but they do not replace scoped tokens and short-lived credentials.
When evaluating security tools or internal controls, teams should ask whether they can answer these questions quickly:
- Which projects installed a specific package version during a specific time window?
- Which CI jobs had access to package publishing tokens or cloud deployment credentials?
- Can builds run with restricted network egress by default?
- Are package installs allowed to run lifecycle scripts in CI?
- Are npm, PyPI, GitHub and cloud tokens scoped narrowly enough that one compromised runner cannot cascade into a publishing incident?
- Can the team invalidate and rotate developer and CI secrets without a multi-day manual effort?
The best response is layered. Pin dependencies, review lockfiles, restrict install-time script execution where possible, use short-lived credentials, limit token scopes, monitor package publishing activity and keep build systems isolated from broader production access.
The Bottom Line
The Mistral and TanStack compromises are a reminder that package managers are now part of the enterprise attack surface. The affected Mistral PyPI release deserves immediate attention because it executed malicious code on import on Linux systems and attempted to run a second-stage payload in the background.
Teams that installed affected packages should treat exposed developer machines and CI runners as credential-risk events, not just dependency cleanup tasks. Remove the affected versions, check lockfiles and caches, rotate secrets available to those environments and review recent publishing and cloud activity.
For organizations buying or improving supply-chain defenses, the lesson is direct: dependency security, CI/CD security and secret management need to be evaluated together. Attackers do not care which budget line owns the control gap.


