Malicious and Credential-Stealing npm Packages Target Developers via Obfuscation and Typosquatting
Multiple malicious npm packages have been discovered targeting developers by employing advanced obfuscation techniques and typosquatting to mimic popular legitimate packages such as TypeScript, discord.js, ethers.js, nodemon, and Claude Code. Security researchers revealed that these packages use up to four layers of obfuscation—including eval wrapping, XOR encryption, URL encoding, and control flow manipulation—to evade static analysis and conceal credential-stealing malware. The attack chain often begins with deceptive tactics, such as displaying fake CAPTCHAs, and proceeds to exfiltrate sensitive information like IP addresses and credentials to attacker-controlled servers. In one notable case, a package impersonating the official Anthropic CLI was found to proxy commands and data back to the threat actor, enabling both credential theft and remote command execution.
These incidents highlight the persistent risks posed by weak validation and oversight in the npm ecosystem, allowing threat actors to publish lookalike packages that are difficult to distinguish from legitimate ones. The sophisticated payloads not only target local developer environments but can also compromise CI/CD pipelines, amplifying the potential impact. Security experts emphasize the need for improved package metadata validation and greater vigilance among developers to mitigate the risk of supply chain attacks through open-source dependencies.

Get ahead of threats like this
Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.
How this story unfolded
3 events from the most recent confirmed update back to the earliest known activity.
Security guidance is published on practical npm supply-chain defenses
A follow-up security discussion highlighted practical steps for staying safe on npm, reflecting industry response to ongoing malicious-package threats. This was guidance and awareness activity rather than a new attack event.
Researchers reveal credential-stealing npm packages using four obfuscation layers
Analysis published days later described npm packages that stole credentials while hiding their behavior behind four layers of obfuscation. The reporting indicates a broader malicious package campaign or additional technical detail beyond the initial discovery.
Malicious npm package impersonating Claude Code is discovered
Researchers identified a malicious npm package masquerading as Anthropic's Claude Code tool. The package was designed to deceive developers into installing a trojanized dependency under the guise of a legitimate AI coding utility.
Related entities
Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.
Sources
3 references tracked. Mallory keeps watching after this page renders.
The Changelog Podcast: Practical Steps to Stay Safe on npm
socket.dev
Open sourceCredential-stealing npm packages hide beneath 4 layers of obfuscation
scworld.com
Open sourceMalicious NPM package pretends to be Claude Code
getsafety.com
Open sourceSee the full picture, correlated to your attack surface.
Map indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.


