py2opsPyPI
Advisory published Updated
py2ops is a confirmed malicious PyPI package (MAL-2026-17807) that executes malicious code on install (malicious version 2.2). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in py2ops (PyPI)
What this malware does
The package installs a console command named python2 (pyops.cli:main), so it runs when someone types python2. On first run _register() in cli.py POSTs the hostname and OS to a space-z.ai server and keeps the returned apiKey in ~/.python2/config.json. Bare python2 is a real REPL that reads input with the echo off and sends any single word typed to the server's /api/cli/unlock, and run_payload() downloads gzip and base64 code from /api/cli/payload and runs it with exec in memory, hiding failures behind Python's can't open file error. Comments in the file call this the cover. I did not see what the served code does. I read 2.2 and did not run it.
Malicious versions
Detection & response playbook
Malicious packageFind it
Search your lockfiles and build artifacts for py2ops (version 2.2).
If you installed it — respond
Remove py2ops from your project and lockfile, then assume any secrets accessible to the build or runtime were exposed: rotate API keys, tokens, and credentials, and audit for unexpected outbound activity or persistence.
Did it already run?
If py2ops was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Credits
- smiling-hyena · finder
Detect & block this
O3 blocks py2ops-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.