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.
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:
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.
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:
cron jobs, systemd services, and even poisoning local Git hooks to ensure it survives reboots and continues to operate.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.
T1195.001 - Compromise Software Dependencies: The core of the attack involves publishing malicious packages to public repositories.T1059.007 - JavaScript/JScript: The trap-core.js payload is executed by the npm post-install hook.T1555.003 - Credentials from Web Browsers: The malware actively searches for and steals browser data.T1552.001 - Credentials In Files: The malware scans for credentials stored in local configuration files.T1021.004 - SSH: Stolen SSH keys are used for lateral movement.T1547.006 - Cron: One of several methods used to establish persistence.T1071.001 - Web Protocols: Used for C2 communication and data exfiltration, including to GitHub Gists.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:
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:
eth-security-auditordev-env-bootstrappertrap-core.jsSecurity teams may want to hunt for the following patterns that could indicate related activity:
~/.cursorrules**/CLAUDE.mdnodenode processes spawned during npm install for outbound network connections to unusual destinations.https://gist.github.com/npm install --ignore-scriptsnpm 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.post-install script activity.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.Defensive techniques from the D3FEND framework, such as File Analysis and Process Analysis, are crucial for identifying malicious script behavior at runtime.
package-lock.json, yarn.lock, poetry.lock) and enforce their use to prevent unexpected updates to potentially malicious package versions.npm install --ignore-scripts. Review necessary scripts and run them manually in a controlled environment.Implementing D3FEND countermeasures like Application Isolation and Hardening is critical to containing the blast radius of a compromised dependency.
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.
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.
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.
The TrapDoor supply chain attack campaign was first observed, beginning to publish malicious packages.

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.
Help others stay informed about cybersecurity threats
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.
Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.
Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.
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 detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.