{"id":"MAL-2026-5519","summary":"Malicious code in requests-toolbelt-plus (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (38c64ca050de4910f56bc4a652890b0a378082859cb62153762c6ae08b4b8eae)\nThe package impersonates the popular `requests-toolbelt` library but ships an empty `requests_toolbelt_plus/__init__.py` and places its real logic in `setup.py`. On `pip install`, setup.py checks `/proc/version` for WSL markers and, when matched, opens a TCP socket to the hardcoded IP 185.184.192.205 on port 4444, sends a JSON beacon containing `os.getlogin()`, `os.uname().nodename`, and `os.getcwd()`, then spawns a background thread that reads JSON commands from the socket and executes them via `subprocess.run(cmd, shell=True, capture_output=True, text=True)`, returning stdout/stderr to the operator — full remote command execution against the installer's machine. setup.py also appends a Python one-liner to `~/.bashrc` that re-opens the same socket, `dup2`s stdio onto it, and execs `/bin/bash -i`, giving the attacker a persistent interactive reverse shell that fires on every new login shell and survives package uninstall. The WSL-only gating is a deliberate evasion to stay dormant on non-WSL maintainer machines and execute only on targeted Windows-Subsystem-for-Linux developer hosts.\n\n## Source: kam193 (bd626be82a68d95788077b8b3c87a960c87d971e55496791cedf85154d99087f)\nInstalling the package or importing the module exfiltrates basic information about the host, and the package has no other purpose.\n\n\n---\n\nCategory: PROBABLY_PENTEST - Packages looking like typical pentest packages, but also anything that looks like testing, exploring pre-prepared kits, research & co, with clearly low-harm possibilities.\n\n\nCampaign: GENERIC-standard-pypi-install-pentest\n\n\nReasons (based on the campaign):\n\n\n - The package contains code to exfiltrate basic data from the system, like IP or username. It has a limited risk.\n\n\n - The package overrides the install command in setup.py to execute malicious code during installation.\n","modified":"2026-07-08T23:47:02.365557969Z","published":"2026-06-10T17:11:39Z","database_specific":{"iocs":{"ips":["185.184.192.205"]},"malicious-packages-origins":[{"sha256":"bd626be82a68d95788077b8b3c87a960c87d971e55496791cedf85154d99087f","import_time":"2026-06-10T18:03:22.536305364Z","id":"pypi/GENERIC-standard-pypi-install-pentest/requests-toolbelt-plus","modified_time":"2026-06-10T17:11:39.385096Z","versions":["99.9.9","99.9.10","100.0.0","2026.6.10.172624"],"source":"kam193"},{"source":"amazon-inspector","sha256":"38c64ca050de4910f56bc4a652890b0a378082859cb62153762c6ae08b4b8eae","import_time":"2026-06-10T19:23:47.877638703Z","id":"IN-MAL-2026-005283","modified_time":"2026-06-10T18:26:49Z","versions":["99.9.9"]},{"import_time":"2026-06-10T19:23:48.738470163Z","id":"IN-MAL-2026-005294","modified_time":"2026-06-10T18:41:57Z","versions":["100.0.0"],"source":"amazon-inspector","sha256":"477b55b0e81d5897d1d7252951b472225226bbca8a8d13a70e31cab1e9d13c26"},{"import_time":"2026-06-16T10:17:17.180849181Z","id":"pypi/2026-06-requests-toolbelt-plus/requests-toolbelt-plus","modified_time":"2026-06-16T09:28:08.624458Z","versions":["99.9.9","99.9.10","100.0.0","2026.6.10.172624"],"source":"kam193","sha256":"c11f6b62eb1505dcab0a9ab7e0dbdcebac4234d2b15ce3d3cea5137c1f72e2a2"},{"source":"amazon-inspector","sha256":"0173bad913733e0e237051c0291adc9bb981ebb8f37c690c31d86f35fac64a2c","import_time":"2026-07-08T17:01:30.393492083Z","id":"IN-MAL-2026-008099","modified_time":"2026-07-08T16:24:45Z","versions":["99.9.10"]},{"id":"IN-MAL-2026-008970","modified_time":"2026-07-08T22:59:56Z","versions":["2026.6.10.172624"],"source":"amazon-inspector","sha256":"6cb152292ec03681f787c6ba01ac65e3f45f26165125ccbc955b6cec5788c7bc","import_time":"2026-07-08T23:27:56.572125205Z"}]},"references":[{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/requests-toolbelt-plus"},{"type":"PACKAGE","url":"https://pypi.org/project/requests-toolbelt-plus/99.9.9/"},{"type":"PACKAGE","url":"https://pypi.org/project/requests-toolbelt-plus/100.0.0/"},{"type":"PACKAGE","url":"https://pypi.org/project/requests-toolbelt-plus/99.9.10/"},{"type":"PACKAGE","url":"https://pypi.org/project/requests-toolbelt-plus/2026.6.10.172624/"}],"affected":[{"package":{"name":"requests-toolbelt-plus","ecosystem":"PyPI","purl":"pkg:pypi/requests-toolbelt-plus"},"versions":["99.9.9","99.9.10","100.0.0","2026.6.10.172624"],"database_specific":{"cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"},{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"},{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."},{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."}],"indicators":{"package_integrity":[{"filename":"requests_toolbelt_plus-99.9.9-py3-none-any.whl","hashes":{"blake2b_256":"62b1be1c6a672ebde0f1e5f07834bee2ec69282e165e2b329d60e24949ab49f1","md5":"e98fa689bf5c5701b9a075fae46f9564","sha256":"7fe6c3efb7b642c75cb23bdc84b4978c5c3d48896e38ad67c5c516561aabe10f"}},{"hashes":{"blake2b_256":"abed5c121232e9ab398165d373644d77de1ce266487ba199b69ae525eaf569c0","md5":"889faf0acbe8ae286dfc6178353fedb7","sha256":"1134df5e03681ef11254b3370b1e054d7c2e8db4dd52c5aa59ec02a1d15219e0"},"filename":"requests_toolbelt_plus-99.9.9.tar.gz"}],"evidence_files":[{"path":"setup.py","sha256":"9b86e3072f1ac94de464250b62d35bd74eca80f444a283fbc3f5db6c066c6a6e","tlsh":"404142c1dcb90120e3b3909918259062a7677d033b46d8787abd87b06f8a079a0b95b9"},{"sha256":"a0122930824287222cc11b4598fec403993fe98807725564777d6cea63985118","tlsh":"ced0a79b33862131f4c38089059c465790f9d10171ca2066c4c60ee962cf2489245438","path":"PKG-INFO"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/requests-toolbelt-plus/MAL-2026-5519.json"}}],"schema_version":"1.7.5","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"}]}