Cybersecurity researchers have discovered a new malicious package in the Python Package Index (PyPI) repository that pretends to be the Solana blockchain platform library, but is actually designed to steal victims’ secrets.
“The legitimate Solana Python API project is known as “solana-py” on GitHub, but simply “brine“in the Python software registry, PyPI,” Sonatype researcher Aks Sharma said in a report released last week. “This slight naming discrepancy was exploited by a threat actor who published the ‘solana-py’ project on PyPI.”
The malicious package “solana-py” attracted a total of 1,122 downloads since published on August 4, 2024. It is no longer available for download from PyPI.
The most striking aspect of the library is that it had version numbers 0.34.3, 0.34.4, and 0.34.5. The latest version of the legitimate “solana” package is 0.34.3. This clearly indicates an attempt by the threat actor to trick users searching for “solana” into inadvertently downloading “solana-py” instead.
Moreover, the fake package borrows the real code from its counterpart, but injects additional code into the “__init__.py” script, which is responsible for collecting the Solana blockchain wallet keys from the system.
This information is then passed to a Hugging Face Spaces domain managed by a threat actor (“treeprime-gen.hf(.)space”), again highlighting how threat actors abuse legal services for malicious purposes.
The attack campaign poses a risk to the supply chain, as Sonatype’s investigation revealed that legitimate libraries such as “soldering” were referencing “solana-py” in their PyPI documentationwhich led to a scenario where developers could mistakenly download “solana-py” from PyPI and expand the attack surface.
“In other words, if a developer using a legitimate PyPI “solder” package in their application is misled (by the “solana-py” documentation) and lands on the “solana-py” printed project, they will inadvertently introduce a cryptojacker into their application,” Sharma explained. .
“This will steal not only their secrets, but the secrets of any user who runs the developer’s app.”
The disclosure comes as Phylum said it detected hundreds of thousands of spam npm packages in its registry containing tokens abusing the Tea protocol, a company that was born for the first time in April 2024.
“There is a Tea protocol project taking steps to fix this problem,” supply chain security firm said. “It would be unfair to legitimate Tea protocol participants to have their rewards reduced because others are cheating the system. Also, npm started take down some of these spammersbut the rate of elimination does not match the rate of new publications.’