{
  "id": "devgating-pypi",
  "url": "https://ohshit.app/incidents/devgating-pypi/",
  "title": "DevGating PyPI malware unlocks inside developer processes and persists after uninstall",
  "level": 3,
  "level_name": "sharted",
  "date": "2026-12-02",
  "date_is_approximate": false,
  "updated": null,
  "tags": [
    "PyPI",
    "supply chain",
    "malware"
  ],
  "ecosystems": [
    "python"
  ],
  "summary": "Island disclosed eight malicious PyPI packages across four waves. A loaded requests submodule unlocks persistent Python startup hooks; uninstalling the package leaves those hooks behind. Linux execution was reproduced in a lab; affected users and real-world executions are unknown.",
  "splash": "Python environments importing mailreader/confext or colook/basic-crypt after the specific requests submodule is loaded.",
  "wipe": "Block all eight package names, rebuild affected Python environments from trusted inputs, and investigate startup hooks and exposed credentials.",
  "in_the_wild": "unknown",
  "source_exception": null,
  "cves": [],
  "fixed": [],
  "checklist": [
    {
      "title": "Inventory and block all eight package names",
      "hint": "Search lockfiles, dependency inventories, runner images and installation records for mailreader, confext, colook, basic-crypt, webreader, pafer, resion and pafex. Current analyzed releases include mailreader 2.7.1/2.7.2, confext 0.7.2, colook 1.1.3 and basic-crypt 1.5.2/1.5.3. No safe replacement version is established; the additional basic-crypt 1.5.4 registry upload is not verified safe."
    },
    {
      "title": "Contain execution and rebuild the affected environment",
      "hint": "If imported or startup hooks executed, isolate the host or runner, preserve process/network/filesystem evidence, then stop affected Python processes. Rebuild environments, runners or host images from trusted inputs; inspect hooks in every relevant environment and user site-packages. Replacing one virtualenv does not clean persistence in other directories. pip uninstall leaves unowned files. Do not import suspect packages or unpickle default.config to test exposure."
    },
    {
      "title": "Hunt network and host indicators",
      "hint": "Island publishes 32 indicator rows, including hashes, package accounts and host artifacts; use its full Indicators of compromise table. Network indicators are hxxps://api.npoint[.]io/df37d3253fff53e2034f/login, hxxps://frjmzbjbhwvtdnsuodmu[.]supabase[.]co/functions/v1/save and hxxps://tzqrmubxuluyccmiialf[.]supabase[.]co/functions/v1/register. Inspect py_abi2-log.pth, py_log2/{__init__.py,__cached__.py}, /tmp/pylog.txt, %TEMP%\\pylog.txt, ~/pip3-update.py, /tmp/file.txt, _distutils_hack/__base__.py and altered _distutils_hack/__init__.py/distutils-precedence.pth. Compare setuptools files with trusted originals; legitimate names alone are not malicious. A match alone does not prove compromise. Do not contact the C2 endpoints."
    },
    {
      "title": "Scope credential exposure and prevent reintroduction",
      "hint": "Determine which developer, service or CI secrets were accessible to an executing interpreter; revoke and rotate affected credentials from a clean system and review their use. This is response guidance, not evidence of confirmed credential theft. Reassess installed dependencies and limit agent package installation and unnecessary outbound access; a clean isolated import is insufficient."
    }
  ],
  "sources": [
    {
      "name": "Island original DevGating research and full indicator table",
      "url": "https://www.island.io/blog/devgating-the-pypi-malware-that-stays-silent-until-it-finds-a-developer",
      "says": "December 2 analysis documents four waves/eight packages, environmental prerequisites, Linux lab execution, static-only native analysis, persistence, indicators and unknown field victim scope.",
      "primary": true
    },
    {
      "name": "PyPI mailreader release metadata",
      "url": "https://pypi.org/pypi/mailreader/json",
      "says": "Registry metadata identifies 2.7.1 and 2.7.2 uploads; December 1 timestamps for 2.7.2 differ in time of day from the Island table, so the timeline uses the date only.",
      "primary": true
    },
    {
      "name": "PyPI basic-crypt release metadata",
      "url": "https://pypi.org/pypi/basic-crypt/json",
      "says": "Lists 1.5.2/1.5.3 and a November 30 macOS ARM64 1.5.4 wheel. Metadata does not establish the safety or behavior of that additional build.",
      "primary": true
    }
  ],
  "headline": null,
  "one_liner": null,
  "in_the_wild_note": "Published malware and lab execution confirmed; no identified victims or field executions.",
  "mitigation": null,
  "timeline": [
    {
      "date": "Sep 25, 2026",
      "title": "Campaign begins with the first helper package",
      "body": "Island traces four waves to pafer, followed by webreader/pafer, resion/pafex, colook/basic-crypt and mailreader/confext."
    },
    {
      "date": "Nov 16, 2026",
      "title": "Researchers reproduce the Linux execution chain",
      "body": "With requests loaded first, mailreader 2.7.1 decrypts its payload, installs a startup hook and executes a memory-backed Python fetcher on the next interpreter start."
    },
    {
      "date": "Dec 1, 2026",
      "title": "mailreader 2.7.2 is published",
      "body": "Island says the new release adds functionality while retaining the malicious payload. PyPI metadata dates its uploads to this day."
    },
    {
      "date": "Dec 2, 2026",
      "title": "Island publishes the campaign analysis",
      "body": "Four current packages are reported as still available at disclosure."
    }
  ],
  "body_markdown": "Island disclosed DevGating on December 2: eight malicious packages in four paired waves since September 25. The latest pair is a working mail parser, `mailreader`, plus the `confext` dependency that unpickles its `default.config`. Deserialization runs code before validating the apparent configuration. The report identifies `mailreader` 2.7.1/2.7.2 and `confext` 0.7.2. Earlier pairs are `webreader`/`pafer`, `resion`/`pafex` and `colook`/`basic-crypt`; these belong to one campaign.\n\nThe pure-Python chain decrypts only if `requests.packages.urllib3.util.connection` is already in `sys.modules`. The compiled `colook` 1.1.3 / `basic-crypt` 1.5.2–1.5.3 chain instead keys on `requests.packages.urllib3.util.request`. Installing requests alone is not the prerequisite, and this is not a compromise of requests itself. A clean sandbox importing only the suspect utility may miss the payload.\n\nThe mailreader chain drops `py_abi2-log.pth` and `py_log2/` under Python's package directories. Later interpreter starts launch attacker-controlled code; uninstalling the original package leaves this persistence. The native variant impersonates setuptools using `_distutils_hack` and `distutils-precedence.pth`. Preserve evidence and compare with trusted installations instead of deleting every file with these legitimate names.\n\nIsland reproduced only mailreader's Linux branch, on November 16: the later Python process used anonymous memory files to run an interpreter and fetch further code. macOS and Windows behavior comes from code inspection. The native pair was decrypted and analyzed statically, not executed; its Windows build and served payload were not analyzed. Registry metadata additionally lists basic-crypt 1.5.4, but the report's analysis does not establish its behavior. Treat it as untrusted, rather than a fix.\n\nAn earlier campaign bin served a remote-access trojan; the current mailreader endpoint returned a placeholder during research. Mutable payloads and surviving hooks remain a risk. Island has not identified current-pair victims, established execution behind its download figures, or confirmed theft of source code or cloud credentials. L3 reflects the publicly demonstrated execution chain and durable developer/CI foothold; field exploitation and a mass compromise are not established. No CVE or verified safe release is supplied."
}