Threat feed

DevGating dependency-keyed PyPI malware

DevGating PyPI malware stays silent until the victim's own Python dependencies unlock the payload

Posted · Spectrum Delta Research Team

Summary

An unattributed actor has published eight malicious PyPI packages in four waves since September, using a technique Island named DevGating: the stage is XOR-encrypted with a 42-byte key derived from the loaded module requests.packages.urllib3.util.connection, so it decrypts only inside a real developer process that already imported requests and exits silently in standalone sandbox imports. The loader and payload are split across separate packages and PyPI accounts, with a working mail library shipping the encrypted payload in a config-file pickle unpickled by its helper package, so a scanner examining either package alone sees only part of the chain. Persistence masquerades as setuptools files: a modified _distutils_hack, distutils-precedence.pth and a py_abi2-log.pth launcher writing py_log2 into site-packages, surviving pip uninstall and running on later Python starts including CI jobs holding cloud credentials. On Linux the interpreter and a 156-byte fetcher run from memfd_create memory files with no payload on disk, fetching operator code from a public npoint.io JSON bin, while earlier waves used Supabase edge functions and one bin served a remote-access trojan.

Breakdown

Targets

  • Industry: Software development

Technical exposure

  • Python environments installing packages from the public PyPI index
  • Processes importing requests alongside the malicious package
  • CI jobs and services running Python with cloud credentials present
  • Developer machines without continuous reassessment of installed packages

Adversary

Unattributed actor · eight PyPI packages across four waves, split loader and payload, separate accounts (Island, B/2)

Procedures (5)

  1. Loader gates payload on loaded Python dependencies

    • T1480.001Execution Guardrails: Environmental Keying

    Logs

    • Python package install logs · Installs of mailreader, confext, colook, basic-crypt, resion, pafex, webreader or pafer, most published by accounts that each released exactly one project; helper packages often appeared days before their front package
  2. Payload pickle hidden inside working library config

    • T1027Obfuscated Files or Information
    • T1059.006Command and Scripting Interpreter: Python

    Logs

    • EDR file events · A 5,715-byte default.config read at import time by the confext helper and passed to pickle.loads, whose 12,051-byte pickle invokes builtins.eval before any type check; silent exception handlers hide failed branches
  3. Setuptools-named .pth persistence survives uninstall

    • T1036.005Masquerading: Match Legitimate Resource Name or Location

    Logs

    • EDR file events · py_abi2-log.pth and a py_log2 package with __cached__.py written into site-packages, or a modified setuptools _distutils_hack with __base__.py beside __init__.py and distutils-precedence.pth importing it; files remain after pip uninstall of the front package; lock file pylog.txt in the temp directory
  4. Interpreter and fetcher run from anonymous memory

    Logs

    • EDR process and file events · On Linux, memfd_create placing a copy of the Python interpreter and a 156-byte fetcher in memory-backed files with no payload file on disk, detached with discarded output; on Windows, exec inside a hidden python.exe with no child process; on macOS, ~/pip3-update.py run and overwritten within three seconds
  5. Stage fetches operator code from public bin C2

    Logs

    • Web proxy and DNS logs · Python processes fetching api.npoint.io bin df37d3253fff53e2034f/login or Supabase edge functions v1/save and v1/register; block developer bins and paste services from CI where no business need exists; C2 content can change, bin IDs are the stable indicator

Indicators of compromise

Domains (3)

  • api.npoint.ioPublic JSON-bin service used as mailreader C2; legitimate site, hunt on the bin ID (Island)
  • frjmzbjbhwvtdnsuodmu.supabase.coSupabase edge-function host, wave 1 RAT data endpoint v1/save (Island)
  • tzqrmubxuluyccmiialf.supabase.coSupabase edge-function host, wave 2b C2 v1/register returning Python to execute (Island)

URLs (3)

  • https://api.npoint.io/df37d3253fff53e2034f/loginmailreader C2 JSON bin; operator can change what infected machines run (Island)
  • https://frjmzbjbhwvtdnsuodmu.supabase.co/functions/v1/saveEarlier RAT data exfiltration endpoint (Island)
  • https://tzqrmubxuluyccmiialf.supabase.co/functions/v1/registerCompiled-wave C2 returning Python for the memory loader (Island)

Hashes (6)

  • 824b3df224c9052ae9c01f4dc6807014eecb37855fc888b16c9098887f962fb0mailreader-2.7.1-py3-none-any.whl SHA-256 (Island)
  • 8b39970f7fc5c58646980092f0114753280ca5ed7df00f3e8d0774f430281631confext-0.7.2-py3-none-any.whl SHA-256 (Island)
  • 8960d524263c8ef189fc8070bb684d6673de5d2e07fda19ec054af82f4eeeb1ecolook-1.1.3-py3-none-any.whl SHA-256 (Island)
  • a27b99b6c79a087b5cdf89559f84fb53ca02fa25352ed3112e25e4257346f55dbasic_crypt-1.5.3 manylinux1 x86_64 wheel SHA-256 (Island)
  • d3927b5df082941274e3774df444ed34e6326045ba18af9ec20127cb8d4932bfDropped _distutils_hack/__base__.py memory loader SHA-256 (Island)
  • 6a3221b95503aa1ac28f3469f9073016MD5 of the doubled module-name string selecting the XOR key from sys.modules, not a file hash (Island)

Sources

Questions, detections or sightings of DevGating dependency-keyed PyPI malware? Bring them to the community.