Malicious package · PyPI
Malicious code in metrics-sdk (PyPI)
1000.0.01001.0.0999.0.0No safe version. Remove it.What it does
metrics_sdk 999.0.0 is a dependency-confusion beacon. setup.py runs on pip install and metrics_sdk/init.py runs on import metrics_sdk; both hex-encode the installer's hostname into a subdomain label of the form mssdk-<event>-<hexhostname>.84avt3516s4q1obsv9q0mh4u2l8dw3ks.x9.to and then trigger socket.gethostbyname(host) plus urllib.request.urlopen('http://' + host + '/'), leaking the hostname to a hardcoded third-party domain over both DNS and plaintext HTTP. The version number 999.0.0 and the package description labeling itself a 'dependency-confusion PoC placeholder' are consistent with an artifact designed to win resolution against an internal package name from public PyPI and beacon from whichever build system pulls it in. The self-label is author-controlled and does not change the observable behavior: any installer that resolves this package on pip install or on import discloses its hostname to an attacker-controlled beacon domain with no opt-in.
Reported by kam193 Installing the package or importing the module exfiltrates basic information about the host, and the package has no other purpose.
No fix · Remove and contain
pip uninstall metrics-sdkSources