11 malicious PyPI Python libraries caught stealing Discord tokens and installing shells
Cybersecurity researchers have discovered as many as 11 malicious Python packages, downloaded more than 41,000 times in total from the Python Package Index (PyPI). They could be used to steal Discord access tokens and passwords, or even stage dependency-confusion attacks.

Cybersecurity researchers have discovered as many as 11 malicious Python packages, downloaded more than 41,000 times in total from the Python Package Index (PyPI). They could be used to steal Discord access tokens and passwords, or even stage dependency-confusion attacks.
The packages have been removed following responsible disclosure by DevOps company JFrog:
- importantpackage / important-package
- pptest
- ipboards
- owlmoon
- DiscordSafety
- trrfab
- 10Cent10 / 10Cent11
- yandex-yt
- yiffparty
Two packages, importantpackage and 10Cent10 and their variants, were found to establish a reverse shell on a compromised machine, giving an attacker complete control. Two others, ipboards and trrfab, pose as legitimate dependencies intended to be imported automatically through a technique called dependency confusion or namespace confusion.
Unlike typosquatting, where a malicious actor deliberately publishes packages with misspellings of popular names, dependency confusion uploads poisoned components to public repositories using names identical to legitimate ones but higher version numbers, effectively causing the target package manager to download and install the malicious module.
The importantpackage dependency also stands out for its novel exfiltration mechanism and evasion of network-based detection, using Fastly's content-delivery network (CDN) to disguise communication with an attacker-controlled server as communication with pypi[.]org.
The malicious code sends an HTTPS request to pypi.python[.]org that is indistinguishable from a legitimate PyPI request, and the CDN later reroutes it as an HTTP request to the command-and-control server, JFrog researchers Andrey Polkovnychenko and Shachar Menashe explained.
Finally, both ipboards and a fifth package called pptest were found using DNS tunnelling to exfiltrate data, relying on DNS requests as a communication channel between the victim machine and a remote server.
Efforts to target popular code registries such as Node Package Manager's JavaScript registry (NPM), PyPI and RubyGems have become common and represent a new frontier for attacks.
"Package managers are a growing, powerful vector for unintentionally installing malicious code, and attackers are becoming more sophisticated in their approach," said Menashe, JFrog's senior director of research. "The advanced evasion techniques used in these malicious packages, such as novel exfiltration methods and DNS tunnelling, signal a worrying trend towards stealthier attacks on open-source software."
Indeed, after malicious actors compromised at least three NPM developer accounts to inject code into the popular ua-parser-js, coa and rc packages, GitHub outlined plans earlier this week to strengthen NPM registry security by requiring two-factor authentication (2FA) for maintainers and administrators from the first quarter of 2022.
This comes as the software-development and version-control platform disclosed that it had addressed multiple NPM registry flaws that could leak private package names and allow attackers to bypass authentication and publish versions of any package without authorisation.