PyPI Campaign Deploys DevGating to Unlock Malware Using Victim Python Dependencies

An active supply chain attack campaign targeting the Python Package Index has used a novel DevGating technique that keys malicious payloads to the victim's loaded Python dependencies. The operation, tracked by Island researchers, has run through four waves since September 25, 2026 and involved eight packages published from multiple accounts. Each front package ships legitimate code while the malicious logic is split across a helper package and activated only when specific modules from the requests library are present. Persistence is achieved via .pth files that execute on every Python interpreter start, after which the malware retrieves additional code from npoint.io. Parallel disclosures detail the GhostMap eBPF rootkit distributed via the IronWorm variant of the Shai-Hulud worm and a widespread credential-stealing operation that abused stolen GitHub tokens to compromise over 1,800 repositories.

The Hacker NewsTranslated from English

Read at source

An "active and evolving" campaign targeting the Python Package Index (PyPI) repository has been found to employ a novel technique dubbed DevGating that uses the victim's Python dependencies as a key to unlock the payload. The campaign, according to Island, has been active since September 25, 2026, and spans four waves and eight packages, with the attacker progressively iterating its evasion techniques.

One such version, released earlier this month, adds legitimate functionality while keeping the malicious functionality intact. "Keying a payload to the victim's environment is not new," Island researchers Idan Revivo and Ofek Ronen said. "What we have not seen documented before is the source of the decryption key: the victim's own loaded Python dependencies. The malware uses the name of a module loaded alongside 'requests' to decrypt its payload."

The final payload comes with several layers to help it sidestep detection. Once activated, it establishes persistence by means of a .pth file that ensures it runs automatically when the interpreter starts, irrespective of whether the package exists or has been uninstalled. The end goal of the attack is to execute Python directly from memory on Linux and retrieve code from npoint.io, a one-way JSON store the operator can rewrite at any time. An earlier wave is said to have delivered a remote access trojan (RAT).

The list of identified packages is below:

  • mailreader (versions 2.7.1, 2.7.2)
  • confext (version 0.7.2)
  • webreader
  • pafer
  • resion
  • pafex
  • colook (version 1.1.3)
  • basic-crypt (versions 1.5.2, 1.5.3)

Central to DevGating is the fact that the main payload is split across two packages from two different PyPI accounts so that a scanner that analyzes any one of them in isolation fails to detect the malicious behavior. Case in point, the front package "mailreader" ships a working mail parser library that bypasses code review and typosquat checks. The malicious code, however, resides in a pickle file disguised as a configuration ("default.config") within the package and is only loaded when a second helper package, named "confext," is imported.

The malware then checks whether the running Python process has already loaded a specific dependency associated with the popular requests package ("requests.packages.urllib3.util.connection"), and, if present, uses it as a fingerprint to derive the decryption key necessary to unlock and launch the malicious code. A scanner that tests "mailreader" on its own doesn't load the "requests" module first, and hence concludes the package is harmless.

The disclosure comes as Aqua detailed a Linux eBPF rootkit called GhostMap that has been found to be distributed via an evolved variant of the Shai-Hulud worm called IronWorm. GhostMap also shares some level of implementation overlap with another rootkit put to use in a June 2026 campaign, codenamed Atomic Arch, that compromised hundreds of orphaned packages in the Arch User Repository (AUR).

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in Supply Chain & OSS

Critical RubyGems.org Flaw Allowed Attacker-Controlled Regex in Gem Metadata Leading to Potential RCE
Q-Dir and DesktopOK Utilities Compromised to Deliver Python RAT via Official Channels
Supply Chain Attack Trojanizes Official Q-Dir and DesktopOK Installers to Deploy Python RAT