A wave of malicious npm and PyPI packages has emerged, posing a serious threat to software developers. This campaign, which commenced on September 12, 2023, was first uncovered by Sonatype, revealing 14 malicious packages on npm.
Subsequently, the attack expanded to the PyPI ecosystem following a brief operational pause. Since its inception, the attackers have introduced 45 packages on npm and PyPI, demonstrating a rapidly evolving assault. These malicious packages utilize tactics like typosquatting to mimic legitimate popular packages, deceiving developers into unwittingly installing them. Phylum, the security firm investigating this threat, identified at least seven distinct attack waves with code modifications aimed at enhancing stealth and targeting specificity.
Furthermore, the attackers evolved their methods, shifting from plain text data collection routines to more intricate mechanisms, such as retrieving and executing data-collecting bash scripts from external domains.
The stolen data encompasses sensitive machine and user information, including hostname, usernames, OS versions, IP addresses, and even SSH private keys, which are transmitted to the attackers’ servers. This stolen information could be exploited to compromise developers’ identities and gain unauthorized access to systems, potentially leading to data breaches, server compromise, or even ransomware attacks.
Given the continuous influx of malware in platforms like PyPI and npm, users are strongly advised to exercise caution when selecting and deploying packages on their systems to mitigate the risk of falling victim to these malicious campaigns.