What happened
Security firm Island detailed on December 2 a campaign of eight malicious PyPI packages running since September 25. The malicious code stays locked and only runs in a real developer environment, slipping past scanners and sandboxes. The operator kept publishing updates and the packages were still listed on PyPI.
Why it matters
Developers are the target, and the chain can reach continuous integration jobs and services with access to source code and cloud secrets, Island said. Once run, the startup hook affects later processes on the same Python installation, even after removing the package. An earlier wave delivered a RAT, and each package drew up to a few hundred downloads.
What to do
Review recently added Python packages together with the dependencies they pull in, and treat bundled pickle files and compiled modules in small utilities as code. Watch for unexpected Python startup files and interpreters launched from memory.
For the technical team
- Affected
- Pacotes maliciosos publicados na PyPI na campanha 'DevGating' · Eight malicious PyPI packages in four waves since September 25; four previously unreported. The packages are working Python utilities, one of them a mail parser. Specific names not cited in the source.
- Exploitation
- Campaign reported by Island on December 2. Each package had at most a few hundred downloads as of November 16; Island does not know who installed the latest pair or whether any install ran with the triggering module loaded. An earlier wave delivered a RAT; the current payload is a harmless placeholder.
- Fix
- No fix as of December 2: the packages were still available on PyPI, and Island reported all still listed on December 1 without hearing back, researcher Ofek Ronen said. Island's mitigations: review new packages alongside the dependencies they pull in, treat pickle files and compiled modules as code, watch for unexpected Python startup files and memory-launched interpreters, and run tests with common libraries already loaded.
- Vector
- Working PyPI packages split the malicious code between two packages from separate accounts, so neither shows the full chain alone. The payload is encrypted and its key is a module name from the victim's running Python process; a sandbox importing the package alone sees nothing. Once run, it plants a Python startup hook that survives uninstalling; on Linux it can run Python from memory and fetch later code from a web service the operator can edit at will.
- More details
- Island counted eight evasion layers targeting code review, functional testing, sandboxing, endpoint scanning and domain reputation. On December 1 the operator published an updated version of one package, keeping the malicious chain. Keying malware to its environment already existed, but Island said it had never seen the key drawn from code the victim had already loaded.
Timeline
Incident opened.
Sources 1 source
- DevGating PyPI Malware Hides Until it Reaches Developers Infosecurity Magazine

