Skip to content

DevGating malware on PyPI only activates on real developer machines

Island Security found eight PyPI packages whose payload stays encrypted until it detects a real project's own dependencies already loaded, a trick built to dodge sandboxes and scanners.

Source: Island

Security researchers at Island disclosed a PyPI malware campaign on 2 December that they’re calling DevGating, active since 25 September. Island found eight malicious packages across four waves. Four were still live at disclosure: mailreader (which shipped an update on 1 December), confext, colook and basic-crypt. The other four, pafex, resion, webreader and pafer, have already been removed from PyPI.

The interesting part is how the payload stays hidden. Each package hashes the names of Python modules already loaded in the process and uses that hash as the decryption key, so the malicious code only unpacks once it spots requests.packages.urllib3.util.connection loaded, something that only happens on a machine actually running a real project with the requests library installed. A sandbox or scanner that imports the package in isolation, without that dependency context, never triggers the decryption and sees nothing wrong.

Why it matters: this is a direct answer to how automated dependency scanners get bypassed. A clean result from importing a package in CI or a sandbox tells you less than you’d think if the payload is keyed to signals that only appear in a genuine developer environment. Installing an unfamiliar package to “just see what it does” in isolation is not the same as it being safe.

The caveat: the download counts Island reports for the still-live packages are in the low hundreds, so this is a narrow, targeted campaign rather than a mass-compromise event.

Share

Related reading

More from The Wire

All briefs

node-tar patches a Windows RCE bug triggered by npm install

A newline-injection flaw in node-tar let a crafted archive forge its own file paths and run code during npm install on Windows. The fix landed in a string of releases up to 8.1.0 on 2 December.

via GitHub Security Advisories (isaacs/node-tar)