{"id":"MAL-2026-14587","summary":"Malicious code in pygame-renderkit (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (fdef1a055b3059d56581d5c0d33538e7799cfde5e42d596eb50094d06d984f54)\nsetup.py registers a custom install command that forks a daemonized child during pip install and executes a base64-encoded Python payload via exec(compile(...)). The decoded payload connects to a hardcoded C2 host at 5uj0a8ziyu.localto.net:3900 and provides an interactive reverse shell by duplicating the socket onto stdin/stdout/stderr of /bin/bash (via pty.spawn) or /bin/sh -i, with a 15-second reconnect loop. It also enumerates environment variables matching API, TOKEN, KEY, SECRET, PASS, CRED, AUTH, AWS, AZURE, GCP, OPENAI, ANTHROPIC, and MANUS, reads /etc/passwd, /etc/sudoers, /etc/shadow, ~/.bash_history, and /opt/.manus/current/config, and sends the collected data over TCP to the same host framed with [EXFIL]/[ENDEXFIL] markers. Persistence is established by writing /tmp/.rk_recon.py, installing a per-minute crontab entry, dropping a renderkit.service systemd user unit with Restart=always, and writing /etc/sudoers.d/.renderkit granting the current user NOPASSWD: ALL. The payload is stored as a base64-encoded template with %%HOST%%/%%PORT%% placeholders and the installer forks with start_new_session=True to hide from pip output. The package presents as a pygame utility; none of this behavior matches that stated purpose.\n\n## Source: kam193 (5856daeb3070a9b2a6ffc42d8999ff49c63706ccb27ee683e5fcc4ff175f78f9)\nDuring installation, the package attempts to exfiltrate sensitive environment variables and files, establish persistence and open reverse shell.\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2026-08-pygame-renderkit\n\n\nReasons (based on the campaign):\n\n\n - persistence\n\n\n - The package overrides the install command in setup.py to execute malicious code during installation.\n\n\n - The package contains code to create a reverse shell, allowing an attacker to execute any commands on the victim's machine.\n\n\n - files-exfiltration\n\n\n - exfiltration-env-variables\n","modified":"2026-08-29T12:30:09.786996148Z","published":"2026-08-28T09:55:47Z","database_specific":{"iocs":{"domains":["5uj0a8ziyu.localto.net"]},"malicious-packages-origins":[{"modified_time":"2026-08-28T09:55:47.226508Z","sha256":"5856daeb3070a9b2a6ffc42d8999ff49c63706ccb27ee683e5fcc4ff175f78f9","source":"kam193","versions":["1.2.0"],"id":"pypi/2026-08-pygame-renderkit/pygame-renderkit","import_time":"2026-08-28T10:38:59.563679787Z"},{"modified_time":"2026-08-28T16:43:31Z","sha256":"fdef1a055b3059d56581d5c0d33538e7799cfde5e42d596eb50094d06d984f54","source":"amazon-inspector","versions":["1.2.0"],"id":"IN-MAL-2026-018804","import_time":"2026-08-28T19:33:50.163054566Z"},{"import_time":"2026-08-29T12:23:15.012408983Z","modified_time":"2026-08-28T09:55:47.226508Z","sha256":"039ea05d12048144a31dfde021c4b725fbceb2634d816cca4a97776bc2c55140","source":"kam193","versions":["1.2.0"],"id":"pypi/2026-08-pygame-renderkit/pygame-renderkit"}]},"references":[{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/pygame-renderkit"},{"type":"PACKAGE","url":"https://pypi.org/project/pygame-renderkit/1.2.0/"}],"affected":[{"package":{"name":"pygame-renderkit","ecosystem":"PyPI","purl":"pkg:pypi/pygame-renderkit"},"versions":["1.2.0"],"database_specific":{"indicators":{"package_integrity":[{"filename":"pygame_renderkit-1.2.0-py3-none-any.whl","hashes":{"blake2b_256":"4c8dd740c2ea9776c89c059449e28d532c505823e02b9ad8265c320fc17bdc36","md5":"88fd83e2478825d7f07f68f7bf23fe7e","sha256":"3dfb0db9f896161286b54dcd498f487caa79d5cee1499654e84991dff73ac2e6"}},{"hashes":{"blake2b_256":"92b64748449078ce86e6f7d88fbb56965078d39bc41e852c6b34776373904f65","md5":"2159afa43a753fea6577d1cfcedec980","sha256":"2bea5d7ee5dd2eef24485a804bc0badc240157b14a67e5f3c6e3765eb6675a69"},"filename":"pygame_renderkit-1.2.0.tar.gz"}],"evidence_files":[{"path":"setup.py","sha256":"83c3b28f0de6d30aceaf2fac3b115a37590aae1414484cc23a26999a5b485500","tlsh":"86f1b696c9891134d7d38677201a9541169bb4279f0768b47ffc8340dfce37911b93ba"}]},"cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/pygame-renderkit/MAL-2026-14587.json"}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"},{"name":"Kamil Mańkowski (kam193)","contact":["https://github.com/kam193","https://bad-packages.kam193.eu/"],"type":"REPORTER"}]}