A sophisticated malware campaign dubbed “DevGating” has emerged on PyPI, leveraging developers’ own Python dependencies as decryption keys. Discovered by Island security researchers, the campaign has been active since September 25, 2026, and uses eight malicious packages across four waves to evade detection while enabling remote code execution.
How It Works: Splitting the Attack Between Packages
The attackers arrange their malicious payload across two separate packages published under different PyPI accounts. A “front” package carries seemingly legitimate functionality—like a mail parser or utility—but hides encrypted data, while a companion helper package contains the decryption logic. On its own, each package appears benign. Combined, they unlock hidden functionality once certain dependencies are present.
The latest wave involves two packages named mailreader and confext. The former includes a default.config file containing encrypted data (in a pickle format), while confext unpickles whatever the first package supplies. Also involved are earlier waves: webreader paired with pafer, resion with pafex, and colook with basic-crypt. All of them follow the two-package structure.
Triggering Payloads with Dependency-based Keys
Like a fingerprint, the decryption key depends on the presence of specific modules already loaded in the Python environment—most notably components associated with the popular requests package. Only if modules like requests.packages.urllib3.util.connection or its .util.request variant are present (i.e., already imported in the process), will the malware decrypt and execute its payload. This means that a scanner running tests in isolation—without those dependencies loaded—will miss the threat.
Once activated, the attack establishes persistence by dropping a .pth file so that its code is executed every time Python starts—even after the malicious packages are removed. The final step involves fetching additional code from a remote JSON store at npoint.io, while earlier versions delivered a remote access trojan.
Impact, Detection, and Defense Gaps
None of the front packages mimic well-known projects or rely on high-profile names, making them harder to catch via name-based comparisons. Static analysis or sandboxed testing of these packages in isolation yields no signs of malicious behavior. Only when the front and helper packages are combined—and when loaded in real developer environments—does the danger become visible.
The eight identified packages (with specific versions) include: mailreader (2.7.1, 2.7.2), confext (0.7.2), webreader, pafer, resion, pafex, colook (1.1.3), and basic-crypt (1.5.2, 1.5.3). These span everything from utilities for parsing mail to modules handling terminal colors.
The reveal arrives amid broader concerns over supply chain security. Linux rootkits distributed via evolved worms (eBPF-based samples called GhostMap) and dormant credential stealers inserted into thousands of GitHub repos are also under active scrutiny. Many of those efforts exploit orphaned packages, compromised accounts, or CI/CD pipelines.
For defenders, these findings underline a widening gap: current security tools often assume packages are independent units. The DevGating attack defies that by making behavior contingent on environment and dependency context. Scanners, static analyzers, and sandbox environments must evolve to simulate real-world project import conditions.
What this means: This campaign sheds light on a key blind spot in package ecosystem security. By separating payload and trigger across different packages, and using loaded dependencies as decryption keys, attackers ensure they fly under the radar until code executes “inside” developer workflows. Fixing this will require new tools and processes that test package behavior not just in isolation, but as parts of real dependency graphs. Watch for updates to PyPI policies, improvements to scanning tools, and risk mitigation practices such as dependency locking and integrity checks.