Actively exploited Security news

DevGating: malicious PyPI packages take their key from the developer's own libraries and survive uninstall

On 2 December 2026 researchers at Island documented a PyPI campaign that has shipped eight malicious packages in four waves since September. The payload is split across two packages from different accounts and decrypts only when the process has the requests library loaded, so it stays silent in a bare sandbox. It also leaves behind a .pth file that uninstalling the package does not remove.

Kyberkit editorial team · · event date · reading time 3 minutes · For admins and analysts

Actively exploited: DevGating on PyPI

Key points

  • Island, 2 Dec 2026: the 'DevGating' campaign has pushed eight packages to PyPI in four waves since 25 Sep, each from a different account. The latest pair is mailreader (2.7.1, 2.7.2) and confext (0.7.2).
  • mailreader ships an encrypted default.config that confext unpickles on import. The key to the final stage is a module name from the requests library, so the code only runs in a process that has loaded requests.
  • Persistence comes from a .pth file in site-packages that runs on every Python start and is not removed by pip uninstall. On Linux, further code is pulled from an npoint.io JSON bin and executed in memory.
  • When we checked on the evening of 3 Dec, mailreader and confext were still downloadable from PyPI. Island has reported them; the four older packages are already gone.

Idan Revivo and Ofek Ronen of Island published an analysis on 2 December 2026 of a campaign that has put eight malicious packages on PyPI since 25 September. What's new isn't the data theft but how the code hides from analysis: it only decrypts in an environment that looks like a real developer machine or build.

From our SOC experience: "install, import and watch" is now the standard way to vet packages. It won't catch this one.

What happened

Each package was published by a different account, and each account published just one project. Island groups them into four waves:

Wave Packages Status per Island
1 (from 25 Sep) pafer, webreader removed
2 (from 20 Oct) resion, pafex removed
2b (from 21 Oct) colook 1.1.3, basic-crypt 1.5.2 and 1.5.3 reported
3 (from 27 Oct) confext 0.7.2, mailreader 2.7.1 and 2.7.2 reported

mailreader 2.7.2 landed on PyPI on 1 December 2026 and added a real feature (saving attachments) to make the project look maintained.

How the attack works

The DevGating chain according to Island1. The victim installs mailreader, which pulls in confext as a dependency; 2. On import, confext unpickles default.config shipped with mailreader; 3. The code looks for requests.packages.urllib3.util.connection among loaded modules and derives the key from its name; 4. The decrypted stage writes py_abi2-log.pth, which runs on every Python start; 5. On Linux it fetches code from npoint.io and runs it in memory (memfd_create)1The victim installs mailreader, whichpulls in confext as a dependency2On import, confext unpicklesdefault.config shipped withmailreader3The code looks forrequests.packages.urllib3.util.connection among loaded modules and derivesthe key from its name4The decrypted stage writespy_abi2-log.pth, which runs on everyPython start5On Linux it fetches code fromnpoint.io and runs it in memory(memfd_create)
Simplified from Island, 2 Dec 2026

The operator can swap the content of the C2 bin at any time. During Island's test it served only placeholder code, but the researchers say the October waves delivered a remote-access trojan that sent data to Supabase. Island's description of macOS and Windows behaviour comes from reading the code, not running it.

How to tell if you're affected

Check pip list, your lockfiles (requirements*.txt, poetry.lock, uv.lock) and container images. Indicators from the analysis (defanged, a selection; hashes for every package are on Island's page):

py_abi2-log.pth            in site-packages, contains "import py_log2"
py_log2/__init__.py, py_log2/__cached__.py
distutils-precedence.pth and _distutils_hack/__base__.py   (spoofed, basic-crypt)
/tmp/pylog.txt   %TEMP%\pylog.txt   ~/pip3-update.py
hxxps://api.npoint[.]io/df37d3253fff53e2034f/login
hxxps://tzqrmubxuluyccmiialf[.]supabase[.]co/functions/v1/register
hxxps://frjmzbjbhwvtdnsuodmu[.]supabase[.]co/functions/v1/save
824b3df224c9052ae9c01f4dc6807014eecb37855fc888b16c9098887f962fb0   mailreader-2.7.1 wheel
8b39970f7fc5c58646980092f0114753280ca5ed7df00f3e8d0774f430281631   confext-0.7.2 wheel
d3927b5df082941274e3774df444ed34e6326045ba18af9ec20127cb8d4932bf   _distutils_hack/__base__.py

Note that setuptools legitimately installs distutils-precedence.pth and _distutils_hack. The red flags are a __base__.py file and extra code appended to __init__.py. Our IOC extractor pulls URLs and hashes out of your own logs quickly.

What to do

  1. Block the packages in your internal mirror or registry proxy and remove them from lockfiles.
  2. Throw away affected environments (virtualenvs, images, runners) and rebuild them, or manually delete the .pth files above.
  3. Rotate secrets the affected process could reach.
  4. Block anonymous bins such as npoint.io and paste sites from CI and production where you don't need them, as Island also recommends.
  5. Watch for .pth files: a new .pth that doesn't belong to a known package install is a strong signal.

The compromised Microsoft agent-framework package used a similar .pth trick.

FAQ

Is uninstalling the package enough?

No. The py_abi2-log.pth file (mailreader) or the spoofed distutils-precedence.pth (basic-crypt) belongs to no package, so pip uninstall leaves it in place and it runs on every subsequent Python start. Delete it by hand, or better, throw away the virtual environment or container image and rebuild it.

Why didn't a scanner or sandbox catch it?

The last stage is encrypted and the key is not in the package. It is derived from the name of a requests module that must already be loaded in the process. An analysis that just installs and imports the package sees nothing malicious. Island describes this as a variant of MITRE T1480.001 (environmental keying).

What if the package was only in CI?

Assume attacker code ran with your build's permissions. Rotate every secret the pipeline could reach (registry tokens, cloud keys, GitHub tokens) and review what the build published in that window.

Sources

  1. Island – DevGating: The PyPI Malware That Stays Silent Until It Finds a Developer (Idan Revivo, Ofek Ronen, 2 Dec 2026)
  2. PyPI – mailreader project (versions and upload times, checked 3 Dec 2026)
  3. PyPI – confext project (checked 3 Dec 2026)
  4. The Hacker News – 8 Malicious PyPI Packages Use Python Dependencies as Keys (3 Dec 2026)

Spotted a mistake? Let us know and we will correct it openly.