TeamPCP's Mini Shai-Hulud Worm Compromises TanStack npm Packages

· Original article ↗

Summary

StepSecurity analyzes Mini Shai-Hulud's npm supply-chain campaign, detailing runner-memory credential theft, self-propagation and malicious releases with valid provenance. TanStack confirmed 84 malicious versions across 42 packages.

Key points

  • TanStack's post-mortem confirmed 84 malicious versions across 42 packages, linking the compromise to a pull_request_target attack, GitHub Actions cache poisoning and OIDC token extraction.
  • StepSecurity attributes the campaign to TeamPCP and reports expansion beyond TanStack to UiPath, DraftLab and other maintainers.
  • A malicious optional Git dependency executes a Bun-based payload during installation. Runtime telemetry captured token harvesting and Python reading GitHub Actions Runner.Worker process memory.
  • The worm searches for publishing credentials, enumerates packages controlled by compromised maintainers and uses OIDC token exchange to publish additional infected releases.
  • Malicious packages carried valid provenance tied to the legitimate release pipeline, illustrating that provenance establishes build origin rather than artifact safety.
  • Deobfuscation revealed broad credential harvesting, Claude Code and VS Code persistence hooks, OS-level token-monitoring services and injected workflows for secret collection.
  • Encrypted stolen data is sent through the Session Protocol CDN and GitHub GraphQL commits disguised with Dependabot-style branches. The article recommends auditing dependencies and persistence, isolating affected machines and rotating exposed credentials.

Article Details

Attack Vectors
  • Malicious npm releases execute an obfuscated worm through an injected optional Git dependency and its prepare lifecycle hook.
  • TanStack's post-mortem describes a chain involving pull_request_target abuse, GitHub Actions cache poisoning, and OIDC token extraction from runner memory.
  • Stolen maintainer credentials and per-package OIDC token exchanges enable autonomous publication of infected packages across additional maintainers' portfolios.
  • Compromised release pipelines produce malicious packages with valid SLSA provenance attestations.
  • Injected GitHub Actions workflows serialize repository secrets for direct exfiltration or publication as workflow artifacts.
  • Developer-tool startup hooks and operating-system services repeatedly execute the malware and monitor GitHub tokens.
Defensive Notes
  • Treat secrets accessible to environments that installed compromised versions as exposed, including masked GitHub Actions secrets.
  • The source warns that token revocation can trigger a destructive routine; isolate and image affected machines before revoking the threatening npm tokens.
  • Check lockfiles against affected releases and inspect installed packages for router_init.js, the injected @tanstack/setup dependency, and unexpected Bun execution.
  • Restore clean dependency versions, reinstall dependencies, and remove malicious Claude Code hooks, VS Code tasks, LaunchAgents, systemd services, and injected workflows.
  • Rotate exposed npm tokens, GitHub tokens, cloud credentials, SSH keys, and other accessible secrets after containment.
  • Audit packages published by affected pipelines for downstream infection and review unexpected publish events, dead-drop commits, and outbound connections.
  • Valid SLSA provenance establishes pipeline origin but does not establish that the pipeline or resulting package was safe.
  • Use restrictive CI network egress policies and package-release cooldowns to reduce exfiltration and exposure to newly published malicious releases.

Indicators of compromise

TypeIndicatorContext
DOMAINgit-tanstack[.]comC2 domain contacted by bun.exe during the observed malicious package installation.
EMAILvoicproducoes@gmail[.]comEmail listed by the source under attacker infrastructure associated with the payload-staging GitHub account.
SHA2562ec78d556d696e208927cc503d48e4b5eb56b31abc2870c2ed2e98d6be27fc96Hash of tanstack_runner.js staged in the malicious Git commit.
SHA2567c12d8614c624c70d6dd6fc2ee289332474abaa38f70ebe2cdef064923ca3a9bHash of the malicious @tanstack/setup package.json containing the payload execution hook.
SHA256ab4fcadaec49c03278063dd269ea5eef82d24f2124a8e15d7b90f2fa8601266cHash of router_init.js, the malicious payload embedded in compromised @tanstack packages.
URLhxxps[:]//api[.]masscan[.]cloud/v2/uploadExplicit exfiltration endpoint used by the injected workflow to POST serialized repository secrets.

MITRE ATT&CK

T1027 · Obfuscated Files or InformationThe worm uses a shuffled encoded string table, a PBKDF2-derived substitution cipher, and encrypted secondary payloads to conceal code and sensitive strings.T1036 · MasqueradingMalicious workflows use CodeQL Analysis and Run Formatter labels, while exfiltration commits mimic Dependabot branches and routine dependency updates.T1059.004 · Unix ShellShell commands orchestrate installation, run the memory scraper through sudo python3, and filter extracted secrets using tr, grep, and sort.T1059.006 · PythonA Python payload reads Runner.Worker memory through /proc/{pid}/mem and extracts JSON entries marked isSecret.T1059.007 · JavaScriptInjected npm lifecycle hooks run the JavaScript worm through Bun, including tanstack_runner.js and opensearch_init.js.T1074.001 · Local Data StagingInjected workflows write serialized repository secrets into data.json or format-results.txt before exfiltration or workflow-artifact upload.T1195.002 · Compromise Software Supply ChainThe worm injects malicious code into legitimate npm releases and republishes infected packages through compromised release pipelines.T1528 · Steal Application Access TokenThe payload steals GitHub and OIDC tokens, including tokens extracted from GitHub Actions runner memory, for publication and propagation.T1543.001 · Launch AgentThe macOS persistence installer registers com.user.gh-token-monitor through a LaunchAgent plist to keep monitoring GitHub tokens.T1543.002 · Systemd ServiceThe Linux installer enables a gh-token-monitor systemd user service for persistent GitHub token monitoring.T1552.001 · Credentials In FilesThe payload harvests credentials from more than 100 paths, including .npmrc, cloud credential files, .git-credentials, and developer configuration files.T1552.003 · Shell HistoryThe malware collects shell history files such as ~/.bash_history and ~/.zsh_history to obtain credentials left in commands.T1552.004 · Private KeysThe credential harvest explicitly targets SSH private keys including ~/.ssh/id_rsa and ~/.ssh/id_ed25519.T1552.005 · Cloud Instance Metadata APIThe malware uses AWS IMDSv2 requests to enumerate IAM roles and retrieve temporary credentials, and also queries ECS credential metadata.T1567 · Exfiltration Over Web ServiceEncrypted stolen data is uploaded through Session Protocol's file API and committed to attacker-controlled GitHub repositories through GraphQL.

Threat Actors

Malware

Vendors

Products

AI Package Analystthe maintainers[1][2][3] for the compromised packages. This incident was detected by StepSecurity AI Package Analyst.Bunduring npm install. Two are legitimate calls to registry.npmjs.org. The other two are the attack: bun.exe connecting to git-tanstack.com (the C2 domain) and api.github.com (for worm propagation using stolenClaude Codeproviders, cryptocurrency wallets, AI tools, and messaging apps, and installs persistence hooks in Claude Code, VS Code, and OS-level services that survive reboots. Stolen data is encrypted and exfiltrated throughGitHub ActionsThe attack published malicious versions through the project's own GitHub Actions release pipeline using hijacked OIDC tokens. In an extremely rare escalation, the compromised packages carry valid SLSA Build Level 3Harden-RunnerWe installed @opensearch-project/[email protected] in a GitHub Actions workflow protected by Harden-Runner to observe the attack in real time. You can explore the full network and process insights here:npmthreat group has launched a new wave of their Mini Shai-Hulud worm, actively compromising legitimate npm packages. We have notified the maintainers[1][2][3] for the compromised packages. This incident wasStepSecurity Dev Machine GuardStepSecurity Dev Machine Guard gives security teams real-time visibility into npm packages installed across every enrolled developer device. When a malicious package is identified, teams can immediately search byStepSecurity Secure RegistryStepSecurity Secure Registry provides each enterprise customer with a dedicated, policy-enforced npm registry that sits between your existing package manager (such as JFrog Artifactory) and the public npm registry.VS Codecryptocurrency wallets, AI tools, and messaging apps, and installs persistence hooks in Claude Code, VS Code, and OS-level services that survive reboots. Stolen data is encrypted and exfiltrated through the Session

Related Articles