AI-Generated npm Package Drains Solana Wallets: A Deep Dive
TL;DR
- An AI-generated npm package,
@kodane/patch-manager
, targeted Solana wallets, resulting in over 1,500 downloads before being taken down. - The malicious package used sophisticated techniques to hide its activities and drain funds from unsuspecting users.
- The use of AI in malware development is making these threats harder to detect and more convincing.
Main Content
AI-Generated npm Package Targets Solana Wallets
On July 28, 2025, an AI-generated npm package named @kodane/patch-manager
was identified as malicious software designed to drain Solana wallets. The package was downloaded over 1,500 times before being removed from the npm registry.
Malicious Functionality Exposed
Cybersecurity firm Safety published a report detailing the package’s malicious capabilities. According to the report, @kodane/patch-manager
presented itself as an “NPM Registry Cache Manager” with legitimate functions for “license validation and registry optimization.” However, this was a facade.
“The package
@kodane/patch-manager
is a sophisticated cryptocurrency wallet drainer with multiple malicious functions. The drainer is designed to steal funds from unsuspecting developers and their applications’ users.” 1
Advanced Persistence and Stealth Techniques
The malicious npm package uses a postinstall script to rename and hide files in disguised cache folders across macOS, Linux, and Windows. On Windows, it hides directories with attrib +H
. It maintains persistence by running a background script (connection-pool.js
) that connects to a live Command and Control (C2) server, sharing a unique machine ID and managing multiple infected hosts.
C2 Server Operations
The open C2 server used by the malicious npm package logs wallet thefts without requiring authentication. Once a wallet is found, a second script (transaction-cache.js
) drains funds, leaving just enough to cover fees. Stolen Solana is sent to a hardcoded address, showing high activity likely tied to over 1,500 infected users.

AI-Generated Code Analysis
The package @kodane/patch-manager
was published by the user “Kodane,” who uploaded 19 versions in just two days starting July 28, 2025. While “Kodane” means “offspring” in Japanese, timestamps suggest a UTC+5 origin, possibly Russia, China, or India. The malware’s well-written documentation and descriptive code comments suggest it was likely AI-generated.
“Whenever you point Claude at a source code file and tell it to add something, or modify it in some way, it names the new file ‘Enhanced
’ where ‘thing’ is what it used to be named. To Claude, any time it touches code, it ‘enhances’ it. Even when it deletes things it shouldn’t. It’s still ‘enhanced’ to Claude." [^1]
These clues point to the use of AI to disguise the malicious intent behind professional-looking code.
Implications of AI in Malware Development
Malware developers are increasingly using AI because it helps them create more convincing, well-documented, and harder-to-detect code. AI can generate clean syntax, realistic comments, and professional-looking documentation, making malicious packages appear legitimate. This increases trust and download rates before detection and removal.
Indicators of Compromise (IOCs)
The researchers also published Indicators of Compromise (IOCs) for this threat.
Follow for More Updates
Follow me on Twitter: @securityaffairs and Facebook and Mastodon
For more details, visit the full article: source
Conclusion
The incident involving the @kodane/patch-manager
package highlights the growing sophistication of AI-generated malware. As AI continues to evolve, cybersecurity measures must also adapt to detect and mitigate these advanced threats. Users and developers must remain vigilant and ensure they verify the authenticity of packages before integration.
References
-
Safety (2025). “Threat Actor Uses AI to Create a Better Crypto Wallet Drainer”. Safety. Retrieved 2025-08-01. ↩︎