Weaponized PyPI Package Steals Solana Private Keys Via Supply Chain Attack

A sophisticated supply chain attack targeting Solana developers has compromised over 25,900 downloads through a weaponized Python package that silently steals cryptocurrency private keys during routine development workflows. The malicious campaign, centered around a package called “semantic-types,” represents a new evolution in software supply chain threats by leveraging transitive dependencies and blockchain-based exfiltration methods to […] The post Weaponized PyPI Package Steals Solana Private Keys Via Supply Chain Attack appeared first on Cyber Security News.

May 31, 2025 - 02:20
 0
Weaponized PyPI Package Steals Solana Private Keys Via Supply Chain Attack

A sophisticated supply chain attack targeting Solana developers has compromised over 25,900 downloads through a weaponized Python package that silently steals cryptocurrency private keys during routine development workflows.

The malicious campaign, centered around a package called “semantic-types,” represents a new evolution in software supply chain threats by leveraging transitive dependencies and blockchain-based exfiltration methods to bypass traditional security controls.

The attack operates through a network of six interconnected PyPI packages, with semantic-types serving as the core malicious payload while five additional packages act as delivery vehicles.

These secondary packages, including solana-keypair, solana-publickey, solana-mev-agent-py, solana-trading-bot, and soltrade, all declare semantic-types as a dependency, ensuring that installing any of these seemingly legitimate Solana development tools automatically downloads and executes the hidden malware.

Solana mev agent (Source – Socket.dev)

The threat actor carefully crafted polished documentation and linked the packages to legitimate Stack Overflow discussions and GitHub repositories to establish credibility within the developer community.

Socket analysts identified the malicious campaign through behavioral analysis that detected unauthorized cryptographic operations and suspicious dependency relationships.

The researchers noted that the threat actor employed a delayed activation strategy, initially publishing benign versions of the packages in December 2024 before introducing the malicious payload in late January 2025, allowing early adopters to build trust before the compromise occurred.

The campaign’s timeline reveals a methodical approach, with the malicious semantic-types version 0.1.5 introducing the payload on January 26, 2025, followed by additional package releases to expand the attack’s reach.

The financial implications extend beyond individual developers, as the malware specifically targets Solana private keys that could provide access to cryptocurrency wallets and smart contract credentials.

Once imported into a development environment, the malware silently captures every newly generated keypair and transmits the encrypted private key data to the threat actor through legitimate Solana blockchain transactions, making the exfiltration appear as routine wallet activity.

At the time of discovery, all six packages remained active on PyPI, potentially continuing to compromise additional developer environments and CI/CD pipelines.

Monkey Patching and Runtime Interception Mechanism

The technical sophistication of this attack lies in its use of monkey patching, a dynamic Python technique that replaces functions at runtime without modifying source code on disk.

The malware specifically targets the Keypair class from the solders library, intercepting critical constructor methods including from_seed, from_bytes, and from_base58_string.

When semantic-types is imported, it automatically executes code that wraps these methods with malicious functionality while preserving their original behavior to avoid detection.

The interception process operates through a wrapper function that captures the private key bytes immediately after keypair generation.

The malware encrypts the stolen key using a hardcoded RSA-2048 public key and spawns a background thread to transmit the encrypted data via a Solana memo transaction to the devnet endpoint.

This approach ensures that the exfiltration occurs asynchronously without disrupting the normal application flow, making the compromise virtually invisible to developers and automated monitoring systems.

Celebrate 9 years of ANY.RUN! Unlock the full power of TI Lookup plan (100/300/600/1,000+ search requests), and your request quota will double.

The post Weaponized PyPI Package Steals Solana Private Keys Via Supply Chain Attack appeared first on Cyber Security News.