{"id":"MAL-2026-16128","summary":"Malicious code in pymem-win (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (4c611131ac135f4608698ce56eebd7dc89623b591510a050f2059369c9d51bbf)\nPymem-win is a near-verbatim copy of the legitimate upstream Pymem package (reusing its description, repository URL github.com/srounet/Pymem, and author identity Fabien Reboia \u003csrounet@gmail.com\u003e) republished under a confusable name. The top-level pymem/__init__.py contains a one-line loader that reverses a bytes literal, base64-decodes it, zlib-decompresses it, and passes the result to exec(). This runs unconditionally on `import pymem`, handing full in-process code execution to a payload deliberately hidden behind three stacked transforms. The multi-layer obfuscation around an exec target has no legitimate purpose in a library import path; combined with the typosquat cover story that reuses the upstream author's identity, the package's function on install/import is to run attacker-chosen code inside any process that imports it.\n\n## Source: kam193 (82eb1f11c9b56a2f2c3e97530db43ef94784a2c75697223828403927b0528477)\nDuring import, the obfuscated code downloads and executes an executable. The remote executable did not exist during analysis, but the repository used to host it overlaps with previous campaign 2026-07-yt-api-dlp\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2026-09-pymem-win\n\n\nReasons (based on the campaign):\n\n\n - obfuscation\n\n\n - Downloads and executes a remote executable.\n\n\n - clones-real-package\n","modified":"2026-09-11T23:30:06.364603204Z","published":"2026-09-11T14:47:19Z","database_specific":{"malicious-packages-origins":[{"source":"kam193","versions":["1.14.0","1.14.1","1.14.4","1.14.5","1.14.6"],"id":"pypi/2026-09-pymem-win/pymem-win","import_time":"2026-09-11T15:17:36.016233836Z","modified_time":"2026-09-11T14:47:19.131787Z","sha256":"82eb1f11c9b56a2f2c3e97530db43ef94784a2c75697223828403927b0528477"},{"import_time":"2026-09-11T23:15:30.496433375Z","modified_time":"2026-09-11T22:40:49Z","sha256":"4c611131ac135f4608698ce56eebd7dc89623b591510a050f2059369c9d51bbf","source":"amazon-inspector","versions":["1.14.6"],"id":"IN-MAL-2026-020016"}],"iocs":{"urls":["https://github.com/DreyCode2/youtube-downloader/releases/download/effe/clent.bin"]}},"references":[{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/pymem-win"},{"type":"PACKAGE","url":"https://pypi.org/project/Pymem-win/1.14.6/"}],"affected":[{"package":{"name":"pymem-win","ecosystem":"PyPI","purl":"pkg:pypi/pymem-win"},"versions":["1.14.0","1.14.1","1.14.4","1.14.5","1.14.6"],"database_specific":{"cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"}],"indicators":{"evidence_files":[{"path":"pymem/__init__.py","sha256":"af96f169b2ee5499179f9acf16cdaf07add72feb19dbd28f6b32baa42bf4a72d","tlsh":"5c232102de1dde5681c6c16530e18413cfd104db0a1d3a78b9fcd16a2feeab5c8bda5a"},{"tlsh":"ef21e1138cce5d642e8365c5642914056d31a8173dcd608a77df828e9e9deef40f913d","path":"pyproject.toml","sha256":"beffc3816b5e28f46f1ff800b961d427572c14a658b8b658f88f0f2af4418e49"}],"package_integrity":[{"hashes":{"sha256":"eef73559e9e2c2eb277587ee8966760a04b262bb98bc93d02a0302de6f282ecb","blake2b_256":"9f08109e2087d3802a3c686af2e3055e1e6b5e44dd2de1d8876527c03019bc39","md5":"e2861d59dedee16dfbc87aed41361613"},"filename":"pymem_win-1.14.6-py3-none-any.whl"},{"hashes":{"blake2b_256":"00413c4e1bd00140fbc1e2f1744bb0c77099ff993b8b19ae0d16997db3cff855","md5":"a7ac1cfd6901620ef1d067dae0162c04","sha256":"0bdec21a7ae4c23d38215df7ca650bfa6a81a185f302bd8a3f585c3ddcbb6c63"},"filename":"pymem_win-1.14.6.tar.gz"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/pymem-win/MAL-2026-16128.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"}]}