DevGating PyPI Malware: 8 Packages Keyed to Your Code

By 12 min read
DevGating PyPI malware uses a developer's loaded requests module as its decryption key

A Python email library on PyPI does exactly what it promises, until your project also imports requests. Then it quietly decrypts a hidden stage, plants a startup hook that survives pip uninstall, and asks a free JSON bin what to run next.

In short: DevGating is a PyPI malware technique, named and disclosed by Island researchers Idan Revivo and Ofek Ronen on 2 December 2026, in which packages such as mailreader and confext encrypt their payload with the name of a module that the requests library loads, so the malware only wakes up inside a real developer environment and stays silent in a sandbox.

The story first became public with Island’s blog post on 2 December 2026. Island ties eight packages in four waves, starting on 25 September 2026, to the same operator. When this article was written on 3 December, four of them were still available on PyPI.

What is DevGating PyPI malware?

DevGating is malware that uses your own Python dependencies as its decryption key. Island stresses that keying a payload to the victim’s environment is old; MITRE tracks it as Execution Guardrails: Environmental Keying (T1480.001). What is new is where the key comes from.

Environmental keying means malware only unlocks when it finds something specific on the target. Earlier examples used a domain name or a hostname. DevGating uses the name of a module that is already loaded in the running Python process.

In the mailreader chain, that module is requests.packages.urllib3.util.connection, which appears when a project has imported requests. As Island puts it, “The key is never in the package.” A scanner that only has the package cannot decrypt the stage that matters.

Four figures: 8 packages in four waves, a 42-byte key, 8 evasion layers, 4 packages still live
The operator spent most of the effort on hiding, and the key is built from a module that requests loads. Data: Island and the PyPI JSON API.

Which packages are affected?

Island lists eight packages, published in pairs. In each pair a working “front” package depends on a “helper” or loader package from a different PyPI account. Island says each account published exactly one project.

Package and versions Role PyPI account Status on 3 Dec 2026
mailreader 2.7.1, 2.7.2 Front, ships default.config nigarash Live
confext 0.7.2 Loader kinishuki Live
colook 1.1.3 Front, calls native helper gotadijo Live
basic-crypt 1.5.2, 1.5.3 Helper with compiled module simendi Live (plus 1.5.4, see below)
webreader 2.3.8 Front, ships pickle morichan Removed
resion 22.0.1 Front, ships pickle hositel Removed
pafer 0.9.7, 0.9.8 Loader werson Removed 16 October
pafex 2.3 Loader redomaitic Removed

The live status comes from a check of the PyPI JSON API for this article. The four removed names return “not found”; the four others still list the versions above.

How many people installed them?

Island’s download figures come from pypistats with mirrors excluded, as of 16 November 2026. They are small: a few hundred per package at most. Download counts include scanners and mirrors that slipped through, so they are an upper bound on real victims, not a count of them.

Bar chart of downloads for seven DevGating packages, from 406 for basic-crypt to 117 for pafex
No package passed a few hundred downloads, which suggests the operator was testing quietly rather than spraying. Data: Island (pypistats, 16 November 2026).

Timeline: four waves since September

The campaign evolved in four waves. In three of the four, the helper went live first, before the package that pulls it in.

Wave Front / helper Created What changed
1 webreader / pafer 25 Sep (pafer), 8 Oct (webreader) Pickle in front package, .pth persistence
2 resion / pafex 20 Oct New names, new C2 bin, same split
2b colook / basic-crypt 21 Oct, about 80 minutes apart DevGating and persistence moved into a compiled module
3 mailreader / confext 27 Oct (confext), 10 Nov (mailreader 2.7.1) Back to pure Python, pickle hidden in a config file

On 1 December, while Island was preparing its report, the operator uploaded mailreader 2.7.2. Island says it keeps the same mechanism, persistence and C2, with a small Linux launcher change and a new feature that saves email attachments. Mallory and ZeroHour report that Island notified PyPI on 1 December; the packages were still listed when Island published.

Timeline of the DevGating campaign from the first pafer upload on 25 September to disclosure on 2 December
The operator shipped a new mailreader version the day before disclosure, so the campaign was still active. Data: Island; upload times from the PyPI JSON API.

How does the mailreader infection chain work?

The chain is built so that each step defeats a different control. Island counts eight evasion layers. The conceptual walk-through below omits anything that would help rebuild it.

Step 1: a library that really works

mailreader is a functioning mail library. Island found no malicious .py file in either wheel. A reviewer reading the source would see ordinary code and one module-level call that loads configuration through confext.

Step 2: a pickle disguised as a config file

The payload sits in a file named default.config: 5,715 bytes with a checksum header and zlib-compressed data. Inside is a 12,051-byte pickle.

Pickle is Python’s built-in object serialisation format; loading a pickle can call arbitrary functions, which is why it should never be used on untrusted data. confext calls pickle.loads() first and only then checks that the result is a dictionary. By the time the check runs, the code has already executed.

Step 3: a decoy and silent failure

The evaluated expression runs the next stage and then returns a valid configuration dictionary, so mailreader keeps working. Island notes that every malicious branch ends in except: pass. Nothing is printed, logged or raised.

Step 4: the DevGating key check

The next stage is a 2,774-byte ciphertext with no key next to it. The code walks the list of loaded modules, hashes each name, and compares it with a stored MD5 value. Only requests.packages.urllib3.util.connection matches. That 41-character name plus one derived byte forms a 42-byte key for a simple XOR decryption.

If requests is not loaded, nothing matches and the chain ends quietly. Island says its own sandbox imported requests first, which is how the behaviour surfaced.

Seven-step flow from importing mailreader to fetching code from a JSON bin
Each stage defeats a different check, from code review to file-based endpoint scanning. Data: Island.

Step 5: persistence that outlives uninstall

The decrypted stage writes a small package called py_log2 into the user site-packages directory and a file named py_abi2-log.pth containing one import line. A .pth file is a path configuration file that Python reads at every interpreter start; lines that begin with import are executed. Because the file belongs to no package, pip uninstall mailreader leaves it in place.

Step 6: execution from memory

On Linux, Island watched the launcher create two anonymous in-memory files with memfd_create: a 6,809,944-byte copy of python3 and a 156-byte fetcher. It then runs the copied interpreter on the fetcher, so no new executable is written to disk. A lock file, /tmp/pylog.txt, keeps one copy per host. Island’s Linux detonation produced 5,353 events over 191 seconds.

The macOS branch (a stager at ~/pip3-update.py overwritten after three seconds with a real pip upgrade script) and the Windows branch (a hidden python.exe) come from reading the code, not from running it.

Step 7: a JSON bin decides what runs

The fetcher pulls code from a public JSON bin on npoint.io. Island’s summary is blunt: “The bin decides what runs.” Today the bin returns a placeholder that writes “hello” to /tmp/file.txt every five seconds. In October, an unnamed public URL scanner captured an earlier wave-1 bin that served a remote access trojan sending data to a Supabase edge function.

How is the colook and basic-crypt variant different?

Wave 2b moves the whole chain into compiled code. basic-crypt ships a native module, basic_crypt._native, of about 68 KB, while the C source shipped beside it shows only harmless XOR and CRC32 functions. The module looks for a sibling key module, requests.packages.urllib3.util.request.

For persistence it writes its own _distutils_hack package and distutils-precedence.pth. Those names match real setuptools files, and most of the content matches too; the giveaway is extra lines at the end of __init__.py and a new __base__.py holding the loader. Island analysed this variant statically and did not run it.

The colook source archive also leaked something: at 7.2 MB against an 11 KB wheel, it contains a Windows virtual environment whose config names a user “Samsung” and the path C:\Users\Samsung\Desktop\UIPackage.

Who is affected, and how do you check exposure?

Anyone who installed one of the eight packages, directly or as a dependency, on a machine where requests was also loaded could have run the chain. That includes developer laptops, CI runners, containers and AI coding agents that install packages on their own.

  1. Search requirements*.txt, poetry.lock, uv.lock, Pipfile.lock and pip freeze output across repositories, images and runners for: mailreader, confext, colook, basic-crypt, webreader, pafer, resion, pafex.
  2. On any host with a hit, list .pth files in every site-packages directory and look for py_abi2-log.pth and a py_log2 folder.
  3. Check _distutils_hack for a __base__.py file. Island notes that real setuptools does not ship one.
  4. Look for /tmp/pylog.txt, %TEMP%\pylog.txt, /tmp/file.txt and ~/pip3-update.py.

If you find any of these, treat it as a compromised developer host, not a bad dependency.

How do you detect DevGating?

Detection has to cover behaviour, because the package alone looks clean.

Where to look What to look for
Package inventory The eight names above; wheel SHA-256 values in Island’s IOC table
File system Unexpected .pth files with import lines; py_log2/__cached__.py; _distutils_hack/__base__.py
Process telemetry (Linux) A python3 process executed from /proc/self/fd/ or a memfd, with no file path on disk
Network / proxy logs Python processes reaching api.npoint.io or *.supabase.co edge functions from build or developer hosts
CI logs Package tests that pass while quietly spawning detached child processes

Island’s IOC table names the npoint.io bin path, two Supabase project hosts, the MD5 selector value and wheel hashes for mailreader 2.7.1, confext 0.7.2, colook and basic-crypt. Use the original report for the full list rather than copying it from secondary pages.

MITRE ATT&CK mapping

Island names one technique: T1480.001, Environmental Keying. Threadlinqs maps a wider set, including T1195.001 (compromise software dependencies), T1059.006 (Python), T1546.018 (Python startup hooks), T1497 (sandbox evasion), T1027 (obfuscation), T1140 (decode at runtime) and T1620 (reflective code loading). Those extra mappings are Threadlinqs’ analysis, not Island’s.

How do you mitigate it?

  1. Remove and rebuild, do not just uninstall. Delete the .pth files and dropped packages, or better, rebuild the environment, container or runner from a clean base.
  2. Rotate secrets reachable from affected hosts. Threadlinqs recommends rotating source-control, cloud and CI credentials after any hit, because the payload can change to a stealer at any moment.
  3. Gate new packages. Use an internal mirror or allow-list, and set a minimum package age before new projects can be installed. All eight packages came from fresh single-project accounts.
  4. Test packages with real dependencies loaded. Island’s findings show that sandboxing a package alone misses DevGating, and ZeroHour’s summary advises running package tests with common libraries such as requests already loaded.
  5. Limit egress from build systems. Island advises blocking CI/CD and production access to paste sites, file-sharing services and hosted data bins.
  6. Watch AI coding agents. Island recommends install policies for agents that add dependencies on their own, a risk we also covered in AGENTS.md malware aimed at AI coding assistants.

How does DevGating compare with earlier package malware?

DevGating is not the first PyPI malware to hide in a pickle. Island cites ai-labs-snippets-sdk, reported by ReversingLabs in May 2025, which hid a pickle in a PyTorch model file. Island notes that package had no cover story, no key and no persistence, and was removed within a day.

  DevGating (mailreader / confext) ai-labs-snippets-sdk (May 2025) Fake job NuGet packages (2026)
Hiding place Pickle in a config file, or a compiled module Pickle in a PyTorch model file MSBuild hook in the package
Trigger Import, but only with requests loaded First run Building the project
Sandbox evasion Key taken from loaded modules None noted by Island Build-time only
Persistence .pth hook surviving uninstall None noted by Island Side-loaded DLL
Time on registry Six weeks and counting for colook and basic-crypt About one day July to November 2026

Model and config files are a recurring blind spot. Our coverage of GGUF model malware on Hugging Face showed the same pattern: scanners focused on code miss payloads in data files. For a PyPI attack that worked by hijacking a trusted publisher instead, see the Microsoft Agent Framework PyPI attack.

What DevGating is not

It is not a mass compromise. Download counts are in the low hundreds and the live payload writes “hello” to a file. Island itself says the attacker spent almost all its effort on hiding and almost none on the payload.

It is also not proof of a novel actor. Island has not attributed the campaign, and the link between the two accounts in each pair rests on the shared dependency and the earlier waves, not on account data. The danger is the delivery mechanism: once installed, the operator can push any code later without touching PyPI again.

Open questions

  • Who installed it? Island says it does not know who is behind the 137 mailreader downloads or whether any of them ran with requests loaded.
  • What is basic-crypt 1.5.4? The PyPI API shows a basic-crypt 1.5.4 release, a single macOS arm64 wheel uploaded on 30 November 2026. Island’s report lists only 1.5.2 and 1.5.3, and we have not analysed the new file. Treat it as suspect.
  • Which Supabase host did what? Island lists two Supabase projects, one as the wave-1 RAT data endpoint and one as the wave 2b C2. Some secondary pages mix them up.
  • macOS and Windows behaviour is inferred from code, not observed.
  • Why is it still live? The packages were reported on 1 December and four were still downloadable two days later.

The bottom line

DevGating turns your own dependency tree into the key that unlocks malware, which defeats any scanner that tests a package on its own. Hunt for the eight package names and the leftover .pth hooks, rebuild anything that matched, and start testing new dependencies inside an environment that looks like a real project.

Sources

This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.

Frequently asked questions

What is DevGating malware?

DevGating is the name Island gave to PyPI malware that keys its encrypted payload to the victim's loaded Python modules. The next stage only decrypts when the requests library is already imported, so a sandbox that installs the package alone sees nothing malicious.

Which PyPI packages are part of the DevGating campaign?

Island lists mailreader 2.7.1 and 2.7.2, confext 0.7.2, colook 1.1.3, basic-crypt 1.5.2 and 1.5.3, and the removed packages webreader, pafer, resion and pafex. mailreader, confext, colook and basic-crypt were still on PyPI on 3 December 2026.

Is the mailreader PyPI package malicious?

According to Island, yes. mailreader 2.7.1 and 2.7.2 work as an email library but ship a default.config file containing a pickle that runs code when the package is imported through its confext dependency.

Does pip uninstall remove DevGating malware?

No. The malware writes a .pth file and a separate package (py_abi2-log.pth and py_log2, or a fake _distutils_hack) into site-packages. Those files belong to no package, so uninstalling mailreader or basic-crypt leaves them running at every Python start.

How do I check if I installed DevGating packages?

Search requirements files, lock files and pip freeze output on developer machines, CI runners and images for the eight package names. Then look for py_abi2-log.pth, a py_log2 folder, /tmp/pylog.txt and an extra __base__.py inside _distutils_hack.

Who is behind DevGating?

Nobody knows. Island has not attributed the campaign. A source archive leaked a Windows build path under a user called Samsung, and the scripts use Windows line endings, but that does not identify a person or group.

Why did sandboxes miss the DevGating packages?

A typical sandbox installs and imports one package in a clean environment. requests is never loaded there, so no module name matches the stored hash, decryption never happens, and every failure is swallowed silently.

What MITRE ATT&CK technique is DevGating?

Island maps it to T1480.001, Execution Guardrails: Environmental Keying. Threadlinqs adds supply chain compromise (T1195.001), Python execution (T1059.006) and Python startup hooks (T1546.018), among others.

Keep reading

DevGatingPyPI malwaremailreaderconfextsoftware supply chainPython securitythreat intelligence