DevGating: PyPI Malware Stays Dormant Until It Lands on a Real Developer Machine
Security firm Island has described a software supply chain campaign on the Python Package Index (PyPI) that it calls "DevGating". The malware stays locked until it reaches a real developer environment, so tools that inspect packages in isolation see nothing harmful. Island says the activity has run since September 25, in four waves of eight packages, four of them previously unreported.
The packages were working Python utilities, one of them a mail parser. In each wave the harmful code was split between two packages from separate accounts, so neither showed the full chain when checked alone. The payload was encrypted, and its key was a module name taken from the victim's running Python process. A sandbox importing the package by itself never had that module loaded and saw nothing, while a real project usually would. Island counted eight evasion layers, aimed at controls from code review and functional testing to sandboxing, endpoint scanning and domain reputation.
Once run, the chain planted a Python startup hook that survived uninstalling the package. On Linux it could run Python from memory, and it fetched later code from a developer web service the operator could edit at will. Island said the hook could reach later processes using the same Python installation, including continuous integration jobs and other services with access to source code and cloud secrets. The current payload was a harmless placeholder, though an earlier wave delivered a remote access trojan (RAT).
Each package had at most a few hundred downloads as of November 16, and Island does not know who installed the latest pair. The operator updated one package on December 1. Island researcher Ofek Ronen said the packages were still on PyPI on December 2, and that Island had reported them the day before without a reply.
Why it matters
Teams that rely on sandbox or scanner verdicts before approving a dependency are exposed, because this campaign is built so that an isolated test proves less than it seems. The persistent startup hook also means uninstalling the package does not clean up, and build pipelines holding source code and cloud secrets are within reach. Vetting needs to look at packages together with the dependencies they pull in, and tests need to resemble real projects.
What to do
- Review new packages together with the dependencies they pull in.
- Treat bundled pickle files and compiled modules in small utilities as code.
- Watch for unexpected Python startup files and interpreters launched from memory.
- Run package tests with common libraries already loaded.