Malicious package · PyPI
Malicious code in py-1requests (PyPI)
0.0.1No safe version. Remove it.What it does
py_1requests is a typosquat of the popular requests library (leading 1 inserted inside the name). On import, py_1requests/init.py iterates os.environ and collects every variable whose name starts with SECRET, API, TOKEN, or KEY, then opens a TCP socket to HOST:PORT and sends the serialized dict; HOST and PORT default to 127.0.0.1:9999 but are overridable via the TS_HOST and TS_PORT environment variables. The same init.py spawns a python subprocess that connects to the same host/port and sends a 'SHELL' marker, holding the connection open — a reverse-shell staging path. cli.py prints 'py_1requests installed -- targeting requests' and init.py prints '[typosquat] exfiltrating:...', in-source admissions of purpose. Both behaviors fire unconditionally on import with no documented purpose.
Reported by kam193 During import, the code exfiltrates potentially sensitive env variables. In all analyzed versions the exfiltration target was a localhost, suggesting it was just a test.
No fix · Remove and contain
pip uninstall py-1requestsSources