A trust-based attack vector
The attack relies on a common pattern: the exploitation of software supply chain (software supply chain) vulnerabilities.
Threat actors identify popular projects or tools — in this case, Claude Code — and create:
- Malicious packages on npm that mimic legitimate libraries
- Fake repositories on GitHub that appear official
- Credible documentation and structures to deceive developers
The goal is clear: to get the victim to install malicious code believing they are using a legitimate tool.
The malware used
According to Trend Micro, malicious repositories distribute various families of specialized information-stealing malware:
- Vidar
- GhostSocks
- PureLog Stealer
These tools allow attackers to:
- Steal credentials stored in browsers
- Exfiltrate active session tokens
- Access cryptocurrency wallets
- Collect system information
All this information is sent to attacker-controlled infrastructure, ready for exploitation or sale on underground markets.
How the infection works
The compromise process typically follows these steps:
1. The developer searches for tools related to Claude Code
2. Finds a seemingly legitimate repository on GitHub
3. Follows instructions that include npm package installation
4. Runs the code, silently activating the malware
This type of attack is particularly effective because it occurs within development environments where users tend to trust the code they download.
Why this attack is especially dangerous
This case combines several critical factors:
- Exploitation of technological trends: the popularity of AI increases the attack surface
- Developer-oriented social engineering
- Compromise of the supply chain
- Difficulty in detecting early stages
Additionally, the impact can quickly scale if the compromised code integrates into larger projects or corporate environments.
Implications for developers and enterprises
The risk is not limited to individual users. Organizations may also be affected if:
- They integrate compromised dependencies into internal projects
- Corporate credentials are exposed
- CI/CD pipelines are compromised
In modern environments, a single malicious dependency can spread rapidly across multiple systems.
Mitigation measures
To reduce the risk from this type of threat:
1. Always verify the authenticity of repositories and packages
2. Review download numbers, history, and maintainers
3. Avoid running unvetted code in critical environments
4. Use dependency analysis tools
5. Implement supply chain security policies
6. Monitor suspicious activity after installing new libraries
Conclusion
The case documented by Trend Micro demonstrates how attackers are evolving towards more sophisticated vectors, exploiting the trust within development ecosystems and the rise of artificial intelligence.
The use of tool names like Claude Code, linked to Anthropic, is not coincidental: it reflects a clear manipulation strategy based on technological trends.
In this context, security no longer depends solely on code that is written but also on code that is imported.
Claude Code under Attack: How Cybercriminals Are Using npm and GitHub to Distribute Malware
Summary: A new investigation from Trend Micro underscores an increasing risk in the development ecosystem: the abuse of linked packages and repositories associated with artificial intelligence tools. In this case, the focus is on Claude Code, which has been exploited by malicious actors to distribute malware through npm and fake repositories on GitHub.
Key facts
- Threat actors exploited the packaging error in Anthropic’s Claude Code npm release.
- Malware payloads distributed include Vidar, GhostSocks, and PureLog Stealer.
- The distribution hub was identified as https://github.com/leaked-claude-code/leaked-claude-code
- Current payload is Claude_code_x64.7z with 533 downloads.
Why it matters
This incident highlights the persistent risk in the software supply chain and underscores the need for organizations to take immediate action to protect themselves against similar threats.
Embedded content for: Claude Code under Attack: How Cybercriminals Are Using npm and GitHub to Distribute Malware