Malicious code in mcp-mermaid (npm)
The npm account `atool` was compromised and used to publish 631 malicious versions across 314 npm packages, including mcp-mermaid, in an automated 22-minute burst. Each malicious version injects a preinstall hook executing an obfuscated Bun script that exfiltrates credentials and establishes persistence via CI/CD workflow injection and system daemons.
- Disclosed
- Last updated
- Blast radius
- 631 malicious versions across 314 npm packages; widespread credential exfiltration affecting AWS, GitHub, npm, GCP, Azure, Kubernetes, SSH, Docker, databases, Stripe, and Slack
- Attack vectors
- Threat actor
- Affected entities
- mcp-mermaidnpm package compromised with malicious preinstall hook
A threat actor compromised the npm account atool and published 631 malicious versions across 314 npm packages in a coordinated 22-minute attack campaign dubbed "Mini Shai-Hulud." The mcp-mermaid package was among those affected, modified to include a malicious preinstall hook.
Each malicious version executes a 498KB obfuscated Bun script during installation that exfiltrates sensitive credentials including AWS keys, GitHub PATs, npm tokens, GCP service accounts, Azure credentials, Kubernetes service account tokens, SSH keys, Docker auth configs, database connection strings, Stripe keys, and Slack tokens. The script uses the GitHub API as a covert exfiltration channel, committing stolen data to attacker-controlled repositories following Dune-themed naming patterns (e.g., harkonnen-melange-742).
Beyond credential theft, the malicious payload establishes persistence through multiple mechanisms: CI/CD workflow injection via a GitHub Actions workflow named Run Copilot that dumps all secrets using toJSON(secrets), AI agent session hooks, and a system daemon named kitty-monitor. The attack was attributed to the TeamPCP threat actor and detected by Amazon Inspector and Google Open Source Security.
The incident represents a large-scale supply chain compromise affecting hundreds of npm packages and potentially thousands of downstream users and organizations.
Indicators of compromise
- Packages
- mcp-mermaid
Remediation
- Immediately audit and revoke all credentials (AWS keys, GitHub PATs, npm tokens, GCP service accounts, Azure credentials, Kubernetes tokens, SSH keys, Docker configs, database credentials, Stripe keys, Slack tokens) that may have been exposed
- Remove or downgrade mcp-mermaid and all affected packages to versions prior to the malicious publication
- Review GitHub Actions workflows and CI/CD configurations for unauthorized `Run Copilot` workflows or other suspicious automation
- Check for and remove any system daemons named `kitty-monitor` or similar persistence mechanisms
- Audit git commit history and repositories for suspicious commits with Dune-themed names (e.g., `harkonnen-melange-*`)
- Monitor npm account activity and enable multi-factor authentication on npm and GitHub accounts
- Review CloudTrail, GitHub audit logs, and other security logs for unauthorized access or data exfiltration
- Regenerate all compromised credentials and rotate secrets in CI/CD systems
Sources
- GitHub Advisory GHSA-2f6m-69ww-37wv · GitHub Advisory Database
Cite this entry
"Malicious code in mcp-mermaid (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed July 27, 2026; last updated July 27, 2026. https://supplychainattack.org/incident/malicious-code-in-mcp-mermaid-npm-11fo0p
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- containedcritical
Malicious code in @antv/gi-assets-basic (npm)
A threat actor compromised the npm account 'atool' and published 631 malicious versions across 314 npm packages, including @antv/gi-assets-basic, in an automated 22-minute burst. Each malicious version injects a preinstall hook executing an obfuscated Bun script that exfiltrates credentials and establishes persistence via CI/CD workflow injection and system daemons.
Mini Shai HuludnpmOtherAccount takeoverCompromised packageMalicious commit - containedcritical
Malicious code in ai-figure (npm)
The npm account `atool` was compromised and used to publish 631 malicious versions across 314 npm packages, including ai-figure, in an automated attack. Each version injects a preinstall hook executing an obfuscated Bun script that exfiltrates credentials and establishes persistence via CI/CD workflow injection and system daemons.
Mini Shai HuludTeamPCPnpmOtherAccount takeoverCompromised packageMalicious commit - containedcritical
Malicious code in @antv/gi-assets-algorithm (npm)
The npm account `atool` was compromised and used to publish 631 malicious versions across 314 npm packages, including @antv/gi-assets-algorithm, in an automated 22-minute attack. Each malicious version injects a preinstall hook executing an obfuscated Bun script that exfiltrates credentials and establishes persistence via CI/CD workflow injection and system daemons.
Mini Shai HuludnpmOtherAccount takeoverCompromised packageMalicious commit - containedcritical
Malicious code in @antv/gatsby-theme (npm)
The npm account `atool` was compromised and used to publish 631 malicious versions across 314 packages, including @antv/gatsby-theme. Each version injects a preinstall hook executing an obfuscated Bun script that exfiltrates credentials and establishes persistence via CI/CD workflow injection and system daemons.
Mini Shai HuludnpmOtherAccount takeoverCompromised packageMalicious commit