{"id":"MAL-2025-191784","summary":"Malicious code in loquru (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: kam193 (a98209ec0f506986521ebd7b24de4f266f6bb61aba50f2dc511c391f1037848b)\nIt's a clone of \"loguru\" package which on import loads a second-stage script from loguru[.]guru. This makes a few checks and downloads the next stage, which is a code obfuscated with PyArmor with unclear behaviour.\n\nThe way the malicious code has been embedded could be called a \"sophisticated\" threat. The code is in the _logger.py in two places: the payload in L2242 as a long string constraint of only whitespaces, which are then transformed into bits and bytes, and later compiled and executed using \"types.FunctionType\" during initialisation of Core class.\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2025-07-loquru\n\n\nReasons (based on the campaign):\n\n\n - typosquatting\n\n\n - obfuscation\n\n\n - clones-real-package\n\n\n - Downloads and executes a remote malicious script.\n","modified":"2025-12-12T20:38:37.955286Z","published":"2025-08-01T13:47:41Z","database_specific":{"iocs":{"urls":["https://loguru.guru/version/is_match_revision","https://loguru.guru/version/code"],"domains":["loguru.guru"]},"malicious-packages-origins":[{"modified_time":"2025-08-01T13:47:41.367157Z","ranges":[{"events":[{"introduced":"0"}],"type":"ECOSYSTEM"}],"sha256":"641cc2cb716a258c01b21b9d995e1352779eecf22663d8101ac7e946d362d96b","source":"kam193","id":"pypi/2025-07-loquru/loquru","import_time":"2025-12-02T22:30:55.317137131Z"},{"id":"pypi/2025-07-loquru/loquru","import_time":"2025-12-02T23:07:18.343821479Z","modified_time":"2025-08-01T13:47:41.367157Z","ranges":[{"events":[{"introduced":"0"}],"type":"ECOSYSTEM"}],"sha256":"a98209ec0f506986521ebd7b24de4f266f6bb61aba50f2dc511c391f1037848b","source":"kam193"},{"import_time":"2025-12-10T21:38:57.577061693Z","modified_time":"2025-08-01T13:47:41.367157Z","sha256":"45d6403aae40fb99fdee2c26853d75d2c1616fccb919fb8b28988ec5d535bada","source":"kam193","versions":["0.7.3"],"id":"pypi/2025-07-loquru/loquru"}]},"references":[{"type":"WEB","url":"https://github.com/Delgan/loguru/issues/1363"},{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/loquru"}],"affected":[{"package":{"name":"loquru","ecosystem":"PyPI","purl":"pkg:pypi/loquru"},"versions":["0.7.3"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/loquru/MAL-2025-191784.json"}}],"schema_version":"1.7.3","credits":[{"name":"Kamil Mańkowski (kam193)","contact":["https://github.com/kam193","https://bad-packages.kam193.eu/"]},{"name":"Kamil Mańkowski (kam193)","contact":["https://github.com/kam193","https://bad-packages.kam193.eu/"],"type":"REPORTER"}]}