Skip to content

Response, New York. Noah Park: Check Point Patches Actively Exploited Management Server Path Traversal. Detection, Dallas. Ava Okello: Report Finds Nearly Half of Deployed Detections Need Attention Before SOCs Can Trust Them.

SOCtember

Always First. Fast SOC News.

A diagram from Island's DevGating research titled "Where each step of mailreader runs," showing eight steps from pip install of mailreader 2.7.1 and the pull of confext 0.7.2 from another account, through a pickle in default.config, builtins.eval at import, a key check on whether requests is loaded, persistence through a .pth file and py_log2, a memfd launch of python3 from RAM, to the next stage fetched from api.npoint[.]io. Without the key the chain exits silently.
Image: Island (screenshot, fair use), "DevGating: The PyPI Malware That Stays Silent Until It Finds a Developer," December 2, 2026. Figure 1, where each step of mailreader runs.

Detection

Malicious Python Packages Stay Locked Until They Land in a Real Developer's Project, Using the Victim's Own Loaded Libraries as the Decryption Key, Island Says

Island traced a PyPI campaign that has shipped four waves of paired packages since September, hiding a payload in a config file that decrypts only when a module from the popular requests library is already loaded. Sandboxes see a clean run, uninstalling leaves a startup hook behind, and four of the packages were still on PyPI on Wednesday.

Ava Okello, DetectionLondon6 min read

DALLAS - A run of malicious Python packages keeps its payload encrypted until it is imported into a real developer's project, deriving the key from the name of a module that the widely used requests library has already loaded, researchers at the security company Island said Wednesday. A sandbox that installs and imports the package on its own never loads that module, so it sees nothing.

Island calls the technique DevGating. "Keying a payload to the victim's environment is not new. What we have not seen documented before is the source of the decryption key: the victim's own loaded Python dependencies," wrote the researchers, Idan Revivo and Ofek Ronen.

The campaign has run on the Python Package Index since September 25, 2026, in four waves, each pairing a working "front" utility with a helper package from a separate account. Four of the packages had not been reported before. Island counted downloads in the low hundreds per package as of November 16 and said it does not know who installed the newest pair. The operator published a new version of the latest front package, mailreader 2.7.2, on December 1, adding a feature for saving email attachments while keeping the malicious chain. Island's table lists mailreader, its helper confext, and a compiled pair, colook and basic-crypt, as live and reported. All four still returned project pages on PyPI at about 5:30 p.m. London time on Wednesday.

Eight layers, each aimed at a control

"The attacker put far more effort into avoiding detection than into the malicious code itself," Island wrote, counting eight evasion layers. mailreader is a working mail parser whose own code never calls exec, opens a socket or decodes base64. At import it loads a configuration through confext, and confext calls pickle.loads on the file mailreader ships, a 5,715-byte default.config holding a compressed 12,051-byte pickle whose key instruction calls builtins.eval. confext checks the type of what it loaded only after the code has run, and the evaluated expression hands back a valid config dictionary so tests keep passing. Every malicious branch ends in a silent except: pass.

The next stage is a 2,774-byte ciphertext with no key beside it. The code walks the modules already loaded in the Python process and looks for the one whose doubled name has the MD5 hash 6a3221b95503aa1ac28f3469f9073016, which is requests.packages.urllib3.util.connection. Only then does it decrypt and run. Because requests is one of the most imported packages in Python, a notebook, web service or test run will usually have it loaded long before a mail helper.

A figure from Island's research titled "The key is in the developer process, not the package," contrasting what a sandbox sees (import mailreader, nothing else loaded; walk sys.modules; list stays empty; clean) with what actually runs in a real project (requests loaded, hash matches, stage decrypts; 2,774 bytes, XOR).
Image: Island (screenshot, fair use), December 2, 2026. Figure 6, the DevGating key check.

Uninstalling does not remove it

Once decrypted, the stage writes a small package, py_log2, into the user's site-packages, along with a one-line file, py_abi2-log.pth, that reads import py_log2. Python executes import lines in .pth files every time it starts, and because the file belongs to no package, pip uninstall mailreader leaves it behind. The launcher takes a lock file so only one copy runs per host and names its script __cached__.py.

On Linux, the launcher copies the system's python3 into an anonymous memory file created with memfd_create, puts a 156-byte fetcher in a second one and runs the copy from memory, so there is no new file on disk for a scanner to inspect and the binary's hash matches the real interpreter. On macOS it writes ~/pip3-update.py, runs it and overwrites it after three seconds with a real pip upgrade script. On Windows it runs the payload with exec inside a hidden python.exe.

A figure from Island's research titled "Removing the package leaves the attacker running," showing that install hooks find no post-install script, pip uninstall removes the package's own files and the package is gone, while py_abi2-log.pth stays in site-packages, any Python start runs it and import py_log2 runs before user code.
Image: Island (screenshot, fair use), December 2, 2026. Figure 7, persistence that survives uninstall.

The next stage comes from a free JSON bin at api.npoint[.]io, a developer service with a clean reputation, and today returns a placeholder that writes "hello" to a file every five seconds. Island said a copy of an October bin captured by a public URL scanner showed it once served a remote access trojan that reported to a Supabase edge function at frjmzbjbhwvtdnsuodmu[.]supabase[.]co. When the operator edits the bin, every machine that already ran the chain picks up the new code on its next Python start.

The compiled pair goes further. colook, a working terminal-color library, imports a 68 KB native module from basic-crypt that keys on a sibling module, requests.packages.urllib3.util.request, and then writes look-alike copies of setuptools' _distutils_hack package and distutils-precedence.pth into site-packages, with a loader added in a new __base__.py. Its next stage comes from tzqrmubxuluyccmiialf[.]supabase[.]co.

A figure from Island's research titled "The Linux path, step by step," showing mailreader 2.7.1 detonated with requests imported first: install, pickle eval of default.config, key check, .pth drop of py_abi2-log.pth, then on every Python start import py_log2, a memfd launch of python3 plus the fetcher in RAM, and a beacon to api.npoint[.]io; 5,353 events over 191 seconds.
Image: Island (screenshot, fair use), December 2, 2026. Figure 10, the Linux path step by step.

Where the operator slipped

"The evasion is careful. The operation behind it is not," the researchers wrote. The C2 bin is public, the lock file and .pth file stay on disk, the two-package shape repeats in every wave, and the colook source archive shipped a whole Windows virtual environment whose pyvenv.cfg names the user Samsung and the path C:\Users\Samsung\Desktop\UIPackage.

What to hunt for

  • Unfamiliar .pth files in system and user site-packages, specifically py_abi2-log.pth with a py_log2 package beside it, and a _distutils_hack folder that contains an extra __base__.py.
  • Python processes whose executable path is an anonymous memory file under /proc/self/fd rather than /usr/bin/python3, and Python children launched with no window and discarded output.
  • Traffic from developer machines, CI runners or production hosts to api.npoint.io or unexpected supabase.co edge functions, especially from Python.
  • The packages mailreader, confext, colook, basic-crypt, webreader, pafer, resion and pafex in lock files, requirements and environment inventories. On any host that imported one, remove the .pth file, the dropped package and the lock file, not just the PyPI package, and treat credentials reachable from that interpreter, including CI secrets, as exposed.

Island's own advice is to set package installation policies for AI coding agents, to reassess installed packages as new intelligence arrives rather than only at install time, and to block CI and production environments from reaching public paste sites and hosted data bins where there is no business need. "Software supply chain security does not end when a package is installed," the researchers wrote.

About the Author

Ava Okello

Ava Okello covers detection engineering, EDR telemetry, and SOC hunting for SOCtember from London.

Related stories

Detection desk