← All articles

PyPI Malware Hides Until Developer Dependencies Appear

PyPI Malware Hides Until Developer Dependencies Appear

A PyPI malware campaign is using a technique called DevGating to hide its main payload until a package is installed in a particular developer environment. DevGating uses the victim’s own Python dependencies, which are reusable software components, as part of the key needed to decrypt and run the concealed code.

Island says the campaign has been active since September 25, 2026, and has developed through four waves involving eight packages. One version released earlier in December adds legitimate functionality while retaining the malicious code. The campaign’s latest wave includes mailreader versions 2.7.1 and 2.7.2, plus confext version 0.7.2. Earlier waves involved webreader and pafer, resion and pafex, and colook version 1.1.3 with basic-crypt versions 1.5.2 and 1.5.3.

The attack divides the important components between packages published through different PyPI accounts. PyPI is the Python Package Index, a public repository where developers obtain Python software. In the mailreader and confext pairing, mailreader presents itself as a working mail parser and contains malicious data inside a file called default.config. The file is actually a pickle file, a Python format that can store and later reconstruct data or code. The code that loads it is placed in confext. A scanner examining either package separately may therefore see only an ordinary configuration operation or a parser that processes a file supplied by another package.

The malware stays inactive unless it sees a particular dependency already loaded by the running Python process. In the mailreader wave, it checks for requests.packages.urllib3.util.connection, associated with the popular requests package, and uses the name of the loaded module to derive the decryption key. A scanner testing mailreader alone does not load requests first, but a developer importing requests before mailreader in a backend project may cause the concealed payload to unlock and run. The colook package uses a different module, requests.packages.urllib3.util.request, for the same DevGating approach.

After activation, the payload creates a .pth file. This is a Python startup file that causes code to run whenever the interpreter starts. Island says the mechanism can continue operating even if the original package is later uninstalled. The malware is intended to execute Python directly from memory on Linux and retrieve further code from npoint.io, described as a one-way JSON store that the operator can rewrite at any time. The later description of the campaign refers to code staged in point.io. An earlier wave reportedly delivered a remote access trojan, or RAT, a program that can give an attacker remote control of a system.

Island says the campaign targets developers who search PyPI for a small utility and install the first plausible result. The front packages are generic tools such as a web reader, mail parser and terminal-colour library, rather than copies of famous projects. The researchers say this creates a gap between package analysis and real-world use: static analysis, sandbox testing and functional checks may see harmless behaviour, while the same package can execute malicious code when imported alongside the dependency expected by the attacker.

The wider software supply chain is also facing separate Linux and repository attacks. Aqua reported a Linux eBPF rootkit called GhostMap being distributed through IronWorm, an evolved variant of the Shai-Hulud worm. An eBPF rootkit uses Linux’s extended Berkeley Packet Filter mechanism to operate at a low system level. Aqua says GhostMap manipulates kernel data as it changes, hiding malicious processes, files and network sockets from user-space applications. It shares some implementation overlap with Atomic Arch, a rootkit used in a June 2026 campaign that compromised hundreds of orphaned packages in the Arch User Repository, or AUR, to distribute a stealer and wallet drainer.

Separately, unknown threat actors have used stolen GitHub tokens to push a credential stealer into tens of thousands of repositories since November 10, 2026. The goal is to take GitHub Actions secrets and cloud credentials. The activity spread through automated publishing triggers into at least one Packagist package and one Golang package. At least 1,806 repositories are assessed to be affected, while more than 8,000 received malicious commits between November 10 at 12:46 p.m. and November 12 at 4:35 a.m. UTC.

The stealer is designed to run once, either through GitHub Actions or during npm installation using a postinstall hook, an automatic script that runs after software is installed. It can take repository secrets and cloud credentials, then attempts to use them for deeper access to AWS, Google Cloud and Microsoft Azure by creating new access keys and federated credentials that may outlast the original run. The attackers used compromised accounts to open pull requests titled “docs: dependency audit notes” from a branch named “wfx-docs.” Aikido says 4,837 compromised accounts opened test pull requests in 61,764 repositories.

Those pull requests tested whether a token could write to a repository before adding the stealer through a new workflow file, a modified existing workflow, or an npm postinstall hook in package.json. The new workflow files used the path github/workflows/build-audit-.yml and ran on every code push. SafeDep says attackers usually reverted the commit afterward, making the branch appear clean. Stolen data was sent through HTTP POST requests to 194.150.166[.]244 or 18.143.168[.]96. Aikido said the method has some overlap with GhostAction, a campaign known for inserting rogue secret-scanning workflows disguised as security audits. The operator behind the activity remains unclear.

For businesses running developer environments or repositories, AEU-I provides security-first IT, infrastructure and consulting, which is relevant when reviewing software supply-chain exposure and access to development systems.

Also available in: DeutschItalianoShqip