The Mend.io research team has uncovered a significant threat to machine learning (ML) developers, with over 100 malicious packages detected targeting popular ML libraries on the PyPi registry. These packages, including versions mimicking Pytorch, Matplotlib, and Selenium, employ a typosquatting technique to deceive developers into downloading them. Upon installation, the malicious packages use the Fernet mechanism to decrypt and execute their payloads, initiating a multi-stage attack process.
The attack unfolds with the execution of the setup.py file, containing an encrypted Fernet payload. Once decoded, this payload triggers a series of actions, including fetching additional malicious scripts from remote hosts. These scripts proceed to write obfuscated content into files and execute them, advancing through multiple stages to reveal the true intent of the attack.
Upon investigation, the Mend.io team discovered that the malicious scripts are designed to steal users’ personal information, such as passwords and tokens, while also attempting to collect cryptocurrency. Moreover, the scripts demonstrate sophisticated capabilities, including environment setup, extension and wallet data extraction, Discord token theft, file search and upload, persistence and remote control, and stealth and evasion techniques.
Of particular concern is the script’s repeated attempts to inject malicious content into popular cryptocurrency wallet applications like Atomic and Exodus Wallet. By replacing legitimate files with malicious ones, attackers can compromise the security of these wallets and potentially gain unauthorized access to users’ cryptocurrency assets. This attack underscores the importance of rigorous verification of components introduced into code, especially in the realm of AI and ML, where developers are increasingly targeted by sophisticated attacks.