StackExchange abused to spread malicious PyPi packages as answers

Share:

Threat actors uploaded malicious Python packages to the PyPI repository and promoted them through the StackExchange online question and answer platform.

The packages are named ‘spl-types,’ ‘raydium,’ ‘sol-structs,’ ‘sol-instruct,’ and ‘raydium-sdk’ and download scripts that steal sensitive data from the browser, messaging apps (Telegram, Signal, Session), and cryptocurrency wallet details (Exodus, Electrum, Monero).

The info-stealing malware can also exfiltrate files with specific keywords as well as take screenshots, and sends all the data to a Telegram channel.

Researchers at application security testing company Checkmarx say that while the packages were uploaded to PyPI on June 25 but received the malcicious component in an update on July 3.

The packages are no longer on PyPI they have already been downloaded 2082 times.

Abusing StackExchange

According to Checkmarx’s investigation, the attackers specifically targeted users involved in the Raydium and Solana blockchain projects.

The fact that Raydium does not have a Python library created an exploitation opportunity for the attackers, who used the name for their package without having to resort to typosquatting or other deception techniques.

To promote the packages to the right targets, the attackers created accounts on StackExchange and left comments under popular threads containing links to the malicious packages.

The chosen topics were related to the package names, and the answers given were of high quality, so victims could be tempted download the dangerous packages.

With over two thousand potential infections, estimating the impact of this campaign is difficult, but Checkmarx researchers presented a couple of victim examples in their report.

One case concerns an IT employee who had his Solana cryptocurrency wallet drained as a result of the infection.

In the second example, the malware captured a screenshot of the victim’s private key, which can be used to bypass MFA protections and hijack accounts even without the password.

Notably, that screenshot shows that Windows Virus and Threat Protection scans failed to catch the threat running on the victim’s device.

This tactic has been used in the past. A similar case was reported by Sonatype in May 2024 and involved promoting malicious Python packages on PyPI via StackOverflow answers.

Most software developers are helpful individuals, ready to whip up a script, or point to one that can make things easier. However, using a script from a legitimate platform is not enough as the author should also be trustworthy.

Even so, inspecting the code before using it is the best way to make sure that it has not been modified at a later time for malicious purposes, as it happened in the campaign described by Checkmarx.

Leave a Comment

Your email address will not be published. Required fields are marked *

loader-image
London, GB
1:13 am, Jan 22, 2025
weather icon 3°C
L: 2° | H: 4°
mist
Humidity: 91 %
Pressure: 1008 mb
Wind: 2 mph
Wind Gust: 0 mph
UV Index: 0
Precipitation: 0 mm
Clouds: 100%
Rain Chance: 0%
Visibility: 5 km
Sunrise: 7:52 am
Sunset: 4:31 pm
DailyHourly
Daily ForecastHourly Forecast
Today 9:00 pm
weather icon
2° | 4°°C 1 mm 100% 5 mph 95 % 1008 mb 0 mm/h
Tomorrow 9:00 pm
weather icon
2° | 8°°C 1 mm 100% 17 mph 94 % 1005 mb 0 mm/h
Fri Jan 24 9:00 pm
weather icon
6° | 10°°C 1 mm 100% 24 mph 91 % 1004 mb 0 mm/h
Sat Jan 25 9:00 pm
weather icon
4° | 6°°C 0.89 mm 89% 8 mph 86 % 1012 mb 0 mm/h
Sun Jan 26 9:00 pm
weather icon
5° | 8°°C 0.2 mm 20% 14 mph 86 % 1011 mb 0 mm/h
Today 3:00 am
weather icon
3° | 3°°C 0 mm 0% 3 mph 92 % 1008 mb 0 mm/h
Today 6:00 am
weather icon
3° | 3°°C 0.8 mm 80% 3 mph 95 % 1006 mb 0 mm/h
Today 9:00 am
weather icon
4° | 4°°C 1 mm 100% 3 mph 95 % 1004 mb 0 mm/h
Today 12:00 pm
weather icon
4° | 4°°C 0.8 mm 80% 4 mph 91 % 1003 mb 0 mm/h
Today 3:00 pm
weather icon
4° | 4°°C 0 mm 0% 5 mph 89 % 1002 mb 0 mm/h
Today 6:00 pm
weather icon
3° | 3°°C 0 mm 0% 3 mph 87 % 1003 mb 0 mm/h
Today 9:00 pm
weather icon
2° | 2°°C 0 mm 0% 4 mph 95 % 1004 mb 0 mm/h
Tomorrow 12:00 am
weather icon
2° | 2°°C 0 mm 0% 3 mph 94 % 1004 mb 0 mm/h
Name Price24H (%)
Bitcoin(BTC)
€101,666.87
4.38%
Ethereum(ETH)
€3,218.75
3.63%
XRP(XRP)
€3.07
1.10%
Tether(USDT)
€0.96
0.13%
Solana(SOL)
€242.63
6.43%
Dogecoin(DOGE)
€0.356671
7.44%
USDC(USDC)
€0.96
0.00%
Shiba Inu(SHIB)
€0.000020
4.03%
Pepe(PEPE)
€0.000015
3.75%
Peanut the Squirrel(PNUT)
€0.364163
1.01%
Scroll to Top