Back to technology news
Cybersecurity

Eight Malicious PyPI Packages Use Python Dependencies as Keys to Unlock Hidden Malware

An active and evolving campaign targeting the Python Package Index has been found to employ a novel technique dubbed DevGating that uses the victim's Python dependencies as a key to unlock the payload. According to Island, the campaign has been active since September 25, 2026, and spans four waves and eight packages, with the attacker progressively iterating its evasion techniques. One version released earlier this month adds legitimate functionality while keeping the malicious functionality intact.

Island researchers Idan Revivo and Ofek Ronen said keying a payload to the victim's environment is not new, but the source of the decryption key has not been documented before: the victim's own loaded Python dependencies. The malware uses the name of a module loaded alongside requests to decrypt its payload. Once activated, it establishes persistence by means of a .pth file that ensures it runs automatically when the interpreter starts, irrespective of whether the package exists or has been uninstalled.

The end goal of the attack is to execute Python directly from memory on Linux and retrieve code from npoint.io, a one-way JSON store that the operator can rewrite at any time. An earlier wave is said to have delivered a remote access trojan. Central to DevGating is the fact that the main payload is split across two packages from two different PyPI accounts so that a scanner analyzing either package in isolation fails to detect the malicious behavior.

The front package mailreader ships a working mail parser library that bypasses code review and typosquat checks. The malicious code resides in a pickle file disguised as a configuration called default.config within the package and is only loaded when a second helper package named confext is imported. The malicious data ships in mailreader's own default.config, and the code that unpickles it ships in confext, published from a different account.

A scanner that looks at mailreader alone finds a config call, while a scanner that looks at confext alone finds a config parser that unpickles whatever file its caller ships. Neither package holds the whole story, and a takedown of one leaves the other live, ready to pair with a new front. The payload remains dormant until it detects it is running on a developer's machine by checking whether the running Python process has loaded requests.packages.urllib3.util.connection, then uses it as a fingerprint to derive the decryption key.

While mailreader and confext represent the latest wave, they were preceded by three earlier waves: webreader and pafer, resion and pafex, and colook and basic-crypt. The colook package implements DevGating by searching for a different module, requests.packages.urllib3.util.request. Island said DevGating exposes a gap between how security tools analyze packages and how developers actually use them, allowing a package to pass static analysis, sandbox detonation, and functional testing yet execute malicious code when imported into a real project.

Source credits

The Hacker News. Edited by SetuGeo.

More technology news

Browse all technology news