PyPI Packages Hid Malware That Runs Only With the Requests Library
Want more insights like this?
Security firm Island said on December 2, 2026, that a malware campaign on the Python Package Index (PyPI), Python's main public code registry, has run since September 25 in four waves, eight packages in all. Each front package, including a mail parser called mailreader, really works. The harmful code is split with a helper package from a separate account.
Island calls the trick DevGating. In the two latest waves, the payload stays encrypted, keyed to the name of a module that loads alongside the popular requests library, so a sandbox testing the package alone sees nothing. Once unlocked, the malware adds a Python startup file that survives uninstalling and reaches later jobs on that install, including continuous integration (CI) builds.
The current payload is a harmless placeholder, though an October wave served a remote access trojan. Downloads stayed in the low hundreds as of November 16. Island reported the four packages still listed, including mailreader 2.7.1 and 2.7.2, on December 1, and advises hunting for unexpected Python startup files.
Source: Infosecurity Magazine