TrapDoor attacks npm, PyPI and CratesIO to steal credentials

Published on May 26, 2026 | Translated from Spanish

A supply chain attack campaign called TrapDoor is spreading malware in popular repositories like npm, PyPI, and CratesIO. The malicious packages seek to steal credentials from unsuspecting developers. The threat exploits trust in open-source software to infiltrate development environments.

three interconnected computer screens showing package manager terminals, npm, PyPI, and CratesIO logos dissolving into digital chains, a glowing red trapdoor opening beneath a developer workstation, credential data streams being siphoned through cracked command-line interfaces, malicious code packages sliding down a funnel into open-source repository icons, cinematic cybersecurity visualization, dark server room atmosphere with blue and red neon lighting, floating binary code particles, realistic glass terminal reflections, dramatic low-angle shot showing the attack process, photorealistic technical illustration

How TrapDoor Infects Packages and Evades Detection 🛡️

TrapDoor uses code obfuscation techniques and package names similar to legitimate libraries to deceive developers. Once installed, the packages execute scripts that extract environment variables, access tokens, and credentials stored in configuration files. The attackers then exfiltrate the data to remote servers. To mitigate the risk, verify the authenticity of each package by reviewing its version history, keep security scanners updated, and use static analysis tools.

The Confident Developer and Their Suspicious Package 😅

Because nothing says trust like installing a package called lodash-fix-urgente without reviewing its source code. TrapDoor counts on you thinking updating dependencies is optional. In the end, the malware laughs while you search for why your AWS token appeared on a hacker forum. Remember: verifying a package takes you five minutes; explaining a credential theft takes you an eternity.