Lyrie
← Supply-Chain
0 sources verified·6 min read
By Lyrie Threat Intelligence·5/12/2026

Mini Shai-Hulud Escalates: The Self-Spreading Supply-Chain Worm Now Targets 169+ npm Packages Across Mistral AI, UiPath, OpenSearch, and PyPI

TL;DR

Mini Shai-Hulud — the npm supply-chain worm first observed hitting SAP packages in April — has exploded to 169 npm packages, 373 malicious versions, spreading across TanStack, Mistral AI, UiPath, OpenSearch, Squawk, and now PyPI. The worm steals GitHub Actions OIDC tokens, npm credentials, AWS keys, Vault tokens, and Kubernetes service accounts from developer machines and CI/CD systems, then autonomously republishes itself under stolen identities. PyPI packages guardrails-ai and mistralai are now compromised, with malicious code executing on import. This is not a targeted incident — it's a systematic, self-propagating supply-chain attack with enterprise reach.

What Happened

At 2026-05-11 19:20–19:26 UTC, attackers used a chained GitHub Actions attack (pull_request_target "Pwn Request" pattern + cache poisoning + OIDC token extraction) to compromise the TanStack repository and publish 84 malicious versions across 42 @tanstack/* packages. Within hours, the campaign escalated.

By 2026-05-12 04:50 UTC (8.5 hours later), security teams at Aikido and Socket had identified:

  • 169 npm package names, 373 malicious package-version entries
  • 10+ package namespaces hit: @tanstack, @mistralai, @uipath, @squawk, @tallyui, @beproduct, @draftlab, @draftauth, @taskflow-corp, @tolka
  • Unscoped packages: safe-action, ts-dna, cross-stitch, cmux-agent-mcp, agentwork-cli, git-branch-selector, git-git-git, and others
  • PyPI packages: [email protected], [email protected]
  • Node.js packages: @opensearch-project/opensearch npm versions 3.5.3, 3.6.2, 3.7.0, 3.8.0

The largest clusters:

  • @squawk/*: 87 compromised versions
  • @tanstack/*: 83 compromised versions
  • @uipath/*: 66 compromised versions
  • Unscoped: 39 versions
  • @tallyui/*: 30 versions

Technical Details

The Attack Chain

The worm uses a three-stage infection pipeline:

Stage 1: Trusted Publishing Bypass via OIDC Token Theft

An attacker-controlled GitHub Actions workflow step extracts the runner's OIDC token (normally used for short-lived npm publish tokens) from memory or environment variables, bypassing long-lived npm token requirements. The attacker then mints a new npm publish token and publishes malicious versions directly to the registry.

Stage 2: Malicious Package Delivery

The compromised package includes:

  • router_init.js — 2.3 MB heavily obfuscated payload using javascript-obfuscator string-array rotation (_0x253b dispatcher pattern), 148 beautify()-encoded environment variable accesses, and control-flow flattening
  • Optional dependency pointing to a GitHub-hosted @tanstack/setup with a prepare lifecycle script that executes the payload via bun run tanstack_runner.js && exit 1

Since prepare scripts run automatically during npm install, the payload executes silently on both developer machines and CI/CD runners. The && exit 1 fails the optional dependency gracefully, keeping the install from appearing broken.

Stage 3: Credential Harvesting & Exfiltration

Once running, the implant:

1. Fingerprints the environment: detects if it's running in GitHub Actions, AWS, Kubernetes, HashiCorp Vault

2. Harvests credentials:

- GitHub tokens (GITHUB_TOKEN, ACTIONS_ID_TOKEN_REQUEST_URL for OIDC)

- npm tokens and registry URLs

- AWS credentials (static keys, IMDS instance metadata, Secrets Manager, SSM Parameter Store)

- Kubernetes service account files

- HashiCorp Vault tokens and endpoints

- SSH keys, cloud config files, shell history

3. Exfiltrates via Session P2P network (encrypted, routed through filev2.getsession.org)

4. Establishes persistence on developer machines:

- Writes self-copies to .claude/router_runtime.js (Claude Code hooks)

- Writes to .vscode/tasks.json (VS Code task auto-run)

- Configures settings.json hooks to re-execute on future Claude Code events

Stage 4: Self-Propagation

Using stolen npm OIDC tokens, the worm automatically:

  • Enumerates packages the victim can publish to
  • Identifies the next target package's git repository
  • Injects the malicious dependency and payload
  • Bumps the version and publishes under the stolen identity
  • Repeats autonomously until the credentials are revoked

Why This Matters: The Mistral & UiPath Angle

Mistral AI (@mistralai/mistralai, @mistralai/mistralai-gcp, @mistralai/mistralai-azure) — billions of API calls weekly from AI/LLM deployments — now carries the worm. Any developer or CI environment using Mistral's npm packages for inference, embeddings, or function calling ingests the payload.

UiPath (@uipath/orchestrator-tool, @uipath/robot, @uipath/cli, and 60+ others) — enterprise RPA and process automation platform. Thousands of enterprises use UiPath's npm tooling in build systems that have access to deployment secrets, Kubernetes service accounts, and cloud credentials.

PyPI [email protected] adds insult to injury: the malware executes on import, not on install. The moment Python code imports guardrails, it downloads a remote .pyz file and executes it with python3. No wheel build, no setup hook — direct code execution.

The Campaign Signature

The attacker infrastructure left a calling card at git-tanstack.com:

"We've been online over 2 hours now stealing creds. Regardless I just came to say hello :^) — With Love TeamPCP"

This matches "TeamPCP" references found earlier in the April SAP waves, suggesting this is a continuation or evolution of a sustained, organized supply-chain operation, not a one-off compromise.

Lyrie Assessment

This is the first time we've seen a supply-chain worm self-propagate across both npm and PyPI ecosystems simultaneously. Most supply-chain attacks are one-to-many (one compromised package affects many victims). Mini Shai-Hulud is many-to-many: each compromised package uses stolen credentials to compromise the next one, creating a self-sustaining infection loop.

Critical for Lyrie's audience:

1. OIDC Trusted Publishing is broken if the workflow is compromised. Provenance signatures prove where the package was built, not whether the build was safe. An attacker who reaches into a GitHub Actions workflow can mint OIDC tokens as the original maintainer.

2. CI/CD credential theft in npm packages is now automated. Older supply-chain attacks required manual discovery of leaked secrets. Mini Shai-Hulud queries GitHub APIs, checks AWS IMDS, enumerates Vault endpoints — all autonomously. This is the automation Lyrie's autonomous defense systems need to detect in real time.

3. Developer workstation persistence is now expected. The malware writes to .claude/ and .vscode/ to survive reboots. Any security program assuming "uninstall the package and you're safe" will miss this. Incident response needs deeper filesystem inspection and Claude Code / VS Code hook auditing.

4. Decentralized exfiltration via Session P2P makes blocking ineffective. Traditional perimeter blocks on specific IPs or domains fail when the attacker uses encrypted, distributed infrastructure. DNS blocking of .getsession.org is a partial mitigation, but determined adversaries using Session have P2P fallback paths.

Recommended Actions

Immediate (Next 2 Hours)

1. Scan all lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock) for affected packages:

- @tanstack/, @mistralai/, @uipath/, @squawk/, @tallyui/, @beproduct/nestjs-auth, @draftlab/, @draftauth/, @taskflow-corp/cli, @tolka/cli, @mesadev/, @dirigible-ai/sdk, @supersurkhet/*

- Unscoped: safe-action, ts-dna, cross-stitch, cmux-agent-mcp, agentwork-cli, git-branch-selector, git-git-git, nextmove-mcp, ml-toolkit-ts, wot-api

2. Check for router_init.js in node_modules:

   find node_modules -name "router_init.js" -o -name "tanstack_runner.js" -o -name "router_runtime.js"
   shasum -a 256 <found-file>  # Match against ab4fcadaec49c03278063dd269ea5eef82d24f2124a8e15d7b90f2fa8601266c

3. If any version matches, STOP immediately.

- Assume all secrets (npm tokens, GitHub PATs, AWS keys, Kubernetes creds, Vault tokens) in that environment are compromised.

- Do NOT publish anything new until credentials are rotated.

Short-Term (Next 4 Hours)

4. Rotate all secrets from affected environments:

- npm tokens → revoke all, regenerate with minimal scope

- GitHub PATs → revoke, regenerate

- GitHub Actions OIDC → revoke all trusted publishers from affected repos, re-establish only after code review

- AWS credentials → rotate static keys, revoke instance role sessions, check CloudTrail for unauthorized access

- Kubernetes service account tokens → revoke and regenerate

- HashiCorp Vault → revoke all tokens, audit Vault API access logs

5. Audit developer machines and CI runners:

- find ~/.claude -name "*.js" -o -name "settings.json" — check for router_runtime.js or suspicious hook configs

- find ~/.vscode -name "tasks.json" — check for unexpected task definitions

- find ~ -name ".tanstack" or .setup — check for hidden persistence directories

- Review git log --all [email protected] — check for unexpected commits (indicator of malware using your git identity)

6. For PyPI environments:

- If any project has guardrails-ai or mistralai pinned without a version, pin to pre-compromise versions immediately

- If [email protected] was installed, assume the machine executed arbitrary Python code — full credential rotation required

Medium-Term (Next 48 Hours)

7. Audit recent npm publishes, GitHub Actions runs, and Sigstore provenance records for unusual activity (publishes at odd times, from unusual actors, or with mismatched provenance signatures)

8. Implement OIDC scoping hardening:

   # In GitHub Actions workflows that do NOT need to publish:
   permissions:
     id-token: none
   
   # In workflows that DO publish:
   permissions:
     id-token: write  # explicit only
   # AND pin the publishing job to a specific action version with hash
   - uses: npm/[email protected]=abc123...

9. Block egress to filev2.getsession.org and .getsession.org at the perimeter (DNS-level block is most effective)

10. *Implement Subresource Integrity validation for all @tanstack/, @mistralai/, @uipath/ packages** — store integrity hashes in lockfiles and fail CI on hash mismatch

Sources

1. https://www.aikido.dev/blog/mini-shai-hulud-is-back-tanstack-compromised

2. https://socket.dev/blog/tanstack-npm-packages-compromised-mini-shai-hulud-supply-chain-attack

3. https://tanstack.com/blog/npm-supply-chain-compromise-postmortem


Lyrie.ai Cyber Research Division

Lyrie Verdict

Lyrie's autonomous defense layer flags this class of exposure the moment it surfaces — no signature update required.

Want proof of what an attacker can reach? Get your first Lyrie security scan free