Sophisticated 'TrapDoor' Supply Chain Attack Steals Developer Credentials Across Multiple Open-Source Registries

TrapDoor Supply Chain Attack Hits npm, PyPI, Crates.io, Stealing Crypto & Dev Secrets

CRITICAL
May 26, 2026
7m read
Supply Chain AttackMalwareThreat Actor

Related Entities

Organizations

AWSGitHub SlowMist

Products & Tech

npm PyPI Crates.io MetaMaskBraveClaudeCursor

Other

CoinbaseBinanceTrapDoor

Full Report

Executive Summary

A widespread and sophisticated software supply chain attack, codenamed TrapDoor, has been identified targeting developers across multiple open-source ecosystems, including npm, PyPI, and Crates.io. Since May 22, 2026, attackers have published over 34 malicious packages and 384 compromised versions, aiming to steal developer credentials, cryptocurrency wallets, and other sensitive secrets. The campaign is notable for its cross-platform nature and its innovative use of AI coding assistants for data exfiltration. Organizations, particularly those in the cryptocurrency, DeFi, Solana, and AI sectors, are at high risk and must immediately scrutinize their software dependencies and developer environments for signs of compromise.


Threat Overview

The TrapDoor campaign represents a coordinated and advanced threat, moving beyond simple typosquatting to a multi-faceted attack on the developer workflow. The primary goal is credential theft on a massive scale. The malware embedded within the malicious packages is engineered to harvest a broad spectrum of secrets:

  • Cloud Credentials: AWS access keys and tokens.
  • VCS Tokens: GitHub personal access tokens.
  • Infrastructure Keys: Private SSH keys.
  • Browser Data: Cookies, history, and stored passwords.
  • Cryptocurrency Wallets: Targeting wallets from Coinbase, Binance, MetaMask, and Brave.
  • Configuration Files: Local application and system configuration files.

The attack's execution is tailored to each package manager's ecosystem to ensure the malicious code runs automatically. This includes using post-install scripts in npm, Python import triggers, and Rust build.rs scripts that execute during compilation. This ensures that simply installing or building a project with a compromised dependency is enough to trigger the infection.

Technical Analysis

The core of the attack on the npm front is a payload named trap-core.js. This is not a simple script; it's an advanced piece of malware with multiple capabilities:

  1. Credential Discovery & Validation: The script actively scans the host system for credentials and uses live API calls to AWS and GitHub to validate their authenticity and permissions. This allows the attackers to prioritize and immediately use high-value credentials.
  2. Lateral Movement: Upon stealing SSH keys, the malware attempts to connect to other systems accessible from the compromised developer machine, propagating the infection within the victim's network.
  3. Persistence: The malware establishes a foothold on the host using multiple techniques, including creating cron jobs, systemd services, and even poisoning local Git hooks to ensure it survives reboots and continues to operate.
  4. Exfiltration: Data is exfiltrated using encrypted channels, with some reports indicating the use of GitHub Gists as a covert channel for C2 communications and data staging.

A particularly novel and alarming technique is the abuse of AI coding assistants. The malware was found to modify configuration files like .cursorrules and CLAUDE.md. It injects hidden Unicode characters that are invisible to the human eye but are interpreted by AI assistants like Cursor and Claude. These instructions trick the AI into executing what appears to be a benign security scan but is actually a script to discover and exfiltrate sensitive data, effectively weaponizing the developer's own productivity tools against them.

MITRE ATT&CK Techniques

Impact Assessment

The business impact of the TrapDoor attack is severe and multi-layered. For individual developers, it can lead to financial loss through stolen cryptocurrency and personal identity theft. For organizations, the compromise of a single developer can be a catastrophic event, leading to:

  • Intellectual Property Theft: Loss of source code, proprietary algorithms, and business plans.
  • Full Infrastructure Compromise: Stolen AWS and SSH credentials can give attackers complete control over a company's cloud environment.
  • Further Supply Chain Attacks: Attackers can use a compromised developer's access to inject malicious code into the organization's own software products, victimizing its customers.
  • Financial Loss: Direct theft of corporate cryptocurrency holdings or costs associated with incident response, remediation, and regulatory fines.
  • Reputational Damage: Loss of customer trust, particularly for companies in the high-stakes DeFi and AI sectors.

IOCs — Directly from Articles

The source articles mention malicious package names conceptually but do not provide a definitive list of hashes or C2 domains. The following package names were mentioned as examples:

Type
File Name
Value
eth-security-auditor
Description
Example of a malicious package name.
Type
File Name
Value
dev-env-bootstrapper
Description
Example of a malicious package name.
Type
File Name
Value
trap-core.js
Description
Core payload file observed in npm packages.

Cyber Observables — Hunting Hints

Security teams may want to hunt for the following patterns that could indicate related activity:

Type
File Path
Value
~/.cursorrules
Description
Look for unexpected modifications or presence of non-standard rules.
Context
File Integrity Monitoring
Type
File Path
Value
**/CLAUDE.md
Description
Search for this file in project directories and inspect for unusual content.
Context
Endpoint Detection and Response (EDR)
Type
Process Name
Value
node
Description
Monitor node processes spawned during npm install for outbound network connections to unusual destinations.
Context
EDR / SIEM
Type
URL Pattern
Value
https://gist.github.com/
Description
Scrutinize network traffic from build servers or developer machines making POST requests to GitHub Gists.
Context
Web Proxy Logs / Netflow
Type
Command Line Pattern
Value
npm install --ignore-scripts
Description
While a mitigation, hunting for its absence in build logs where it should be present can be an indicator.
Context
CI/CD Logs

Detection & Response

  1. Dependency Scanning: Immediately run dependency analysis tools (e.g., npm audit, Snyk, Dependabot) across all projects to identify any of the 34+ known malicious packages. Do not rely on package names alone; version numbers are critical.
  2. CI/CD Log Analysis: Review build logs from CI/CD pipelines for any unusual script executions, network connections, or errors during dependency installation steps. Pay close attention to post-install script activity.
  3. Endpoint Monitoring: Deploy EDR rules to detect the creation or modification of persistence mechanisms like cron jobs and systemd services by processes associated with package managers (e.g., node, pip). Monitor for file modifications to AI assistant configuration files like .cursorrules.
  4. Credential Rotation: As a precaution, organizations should consider a full rotation of all developer secrets, including AWS keys, GitHub tokens, and SSH keys. Prioritize developers working on projects within the targeted sectors.

Defensive techniques from the D3FEND framework, such as File Analysis and Process Analysis, are crucial for identifying malicious script behavior at runtime.

Mitigation

  • Lock Dependencies: Use lockfiles (package-lock.json, yarn.lock, poetry.lock) and enforce their use to prevent unexpected updates to potentially malicious package versions.
  • Disable Post-Install Scripts: Where possible, run package installation commands with flags to disable automatic script execution, such as npm install --ignore-scripts. Review necessary scripts and run them manually in a controlled environment.
  • Sandboxed Build Environments: Execute build and installation processes in ephemeral, isolated containers with no access to sensitive network resources or secrets. Use tools to inject secrets at runtime rather than storing them in the environment.
  • Vendor Dependencies: Vet all third-party dependencies and their authors. Prefer packages from well-known, trusted publishers.
  • Principle of Least Privilege: Ensure that CI/CD environments and developer accounts have the minimum necessary permissions. Secrets should be tightly scoped and short-lived.

Implementing D3FEND countermeasures like Application Isolation and Hardening is critical to containing the blast radius of a compromised dependency.

Timeline of Events

1
May 22, 2026
The TrapDoor supply chain attack campaign was first observed, beginning to publish malicious packages.
2
May 26, 2026
This article was published

MITRE ATT&CK Mitigations

Run build processes in ephemeral, isolated containers to limit the blast radius of a malicious package. This prevents it from accessing host system resources or secrets.

Disable the automatic execution of `post-install` scripts (`npm install --ignore-scripts`) to prevent malware from running upon installation.

Audit

M1047enterprise

Regularly audit and monitor CI/CD logs, dependency trees, and network traffic from build environments to detect anomalous activity.

Enforce the use of lockfiles to ensure that only vetted and approved package versions are used in builds, preventing silent upgrades to malicious versions.

D3FEND Defensive Countermeasures

Implement dynamic analysis (sandboxing) for all CI/CD build processes, particularly for dependency installation steps. The sandbox environment should be ephemeral, network-restricted, and contain no production secrets. By executing npm install or pip install within this controlled environment, security teams can monitor for suspicious behaviors indicative of attacks like TrapDoor. This includes unexpected file system writes outside the project directory (e.g., to ~/.ssh/), anomalous outbound network connections (especially to destinations like GitHub Gists), or attempts to spawn child processes. Alerts should be generated if the build process attempts to access or modify sensitive configuration files like .cursorrules or system persistence locations like cron directories. This provides a critical layer of defense by analyzing what the code does rather than just what it is.

Harden the configuration of package managers used in development and CI/CD environments. For npm, this involves setting a global or project-level .npmrc configuration to disable automatic script execution (ignore-scripts=true). This single change directly mitigates the primary execution vector for many npm-based attacks, including TrapDoor, which relies on post-install hooks. For organizations where some scripts are necessary, the policy should be to disable them by default and create an explicit, audited process for re-enabling and running required scripts in a controlled manner. This shifts the security posture from a permissive 'run-by-default' model to a more secure 'deny-by-default' model, forcing a deliberate review of any code that attempts to execute automatically.

Timeline of Events

1
May 22, 2026

The TrapDoor supply chain attack campaign was first observed, beginning to publish malicious packages.

Article Author

Jason Gomes

Jason Gomes

• Cybersecurity Practitioner

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.

Threat Intelligence & AnalysisSecurity Orchestration (SOAR/XSOAR)Incident Response & Digital ForensicsSecurity Operations Center (SOC)SIEM & Security AnalyticsCyber Fusion & Threat SharingSecurity Automation & IntegrationManaged Detection & Response (MDR)

Tags

supply chain attacknpmpypicrates.iocredential theftcryptocurrencymalwaretrapdoorai security

📢 Share This Article

Help others stay informed about cybersecurity threats

🎯 MITRE ATT&CK Mapped

Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.

🧠 Enriched & Analyzed

Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.

🛡️ Actionable Guidance

Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.

🔗 STIX Visualizer

Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.

Sigma Generator

Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.