
Attackers Hide Malware in Eight PyPI Packages Using Loaded Dependencies as Keys
A PyPI campaign has delivered eight malicious packages that remain dormant until a developer's runtime environment supplies a key from an already-loaded dependency. The technique splits malicious code across packages and uses persistence plus remote code retrieval, exposing a gap in tools that scan packages in isolation.
An active PyPI campaign has placed eight malicious packages in the repository, using a technique called DevGating to hide payloads until a developer imports the right dependency. The packages, identified by security researchers at Island, include mailreader, confext, webreader, pafer, resion, pafex, colook and basic-crypt. The campaign has run in four waves since Sept. 25, 2026, with newer versions adding legitimate functionality while retaining malicious behavior.
The evidence centers on split payloads and environment keys. In the latest wave, mailreader ships a working mail parser and a pickle file named default.config; confext, published from a different account, contains the code that unpickles it. The malware checks whether the interpreter has already loaded a module tied to requests, then uses that module name as a fingerprint to derive a decryption key. If the key condition fails, the payload stays dormant.
The technique matters because it defeats tools that inspect one package at a time. A scanner analyzing mailreader alone sees a config call; a scanner analyzing confext alone sees a parser that accepts a file from its caller. Neither package contains the full malicious chain, and removing one can leave the other available to pair with a new front. The campaign also uses a.pth file for persistence and retrieves code from npoint.io, a one-way JSON store.
Developers and security teams are exposed because the attack uses trusted infrastructure and normal imports to trigger execution. The payload runs Python from memory on Linux, fetches code from a remote store the operator can rewrite, and earlier waves delivered a remote access trojan. The source does not attribute the campaign to a named actor, and no CVE is cited. The operational lesson is concrete: dependency scanning must account for cross-package and runtime-environment behavior.
Developers and security teams are exposed because the attack uses trusted imports and split packages to evade tools that analyze one package at a time.
Sources (1)
- [1]Original source(https://thehackernews.com/2026/12/8-malicious-pypi-packages-use-python.html)