{"id":"MAL-2026-6516","summary":"Malicious code in inlifegram (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (3975a0998bf76dddc25f0138b1d4b408bb06304b3203dc1e62e0110b2b56425f)\nInLifeGram distributes a modified copy of the `pyrogram` Telegram client library and installs it into the top-level `pyrogram` import namespace, so `import pyrogram` after installation resolves to this fork. The fork's Client start path has been modified to lazily import a sibling module (`from. import app as secret`) and, when the authenticated account is a bot (`self.me.is_bot`), call `secret.init(self)` wrapped in a bare `except Exception: pass`. The call hands the fully authenticated client object — containing the bot token, api_id/api_hash, and MTProto auth_key — to undocumented code. The receiving `app.py` module consists of a single `exec(zlib.decompress(base64.b85decode(b'...')).decode())` over an ~11KB opaque blob, with no other functionality and an Indonesian-language header threatening anyone who removes 'credits'. The multi-layer obfuscation (base85 → zlib → exec), the silent invocation on bot authentication, and the bare-except suppression are the canonical shape of a session/token-stealing backdoor. README links a sibling project `VLife-Gram` by the same author, indicating a family of trojanized forks. Any program that installs InLifeGram and runs a Pyrogram bot will silently surrender its bot session to the hidden payload on every successful login.\n\n## Source: kam193 (9e2d3483845391abac4b854096ffc1c7767818f9e2b02486d969ee2be0638dc9)\nThe modified version of a Telegram bot library. The obfuscated code, launched when the user starts their own bot application, attaches malicious backdoor commands to the Telegram bot. They allow hardcoded users to execute any commands in the bot's environment.\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2026-06-inlifegram\n\n\nReasons (based on the campaign):\n\n\n - clones-real-package\n\n\n - obfuscation\n\n\n - The package contains code to execute remote commands (probably limited to a specific set) on the victim's machine.\n\n\n - rat\n\n\n - target:telegram\n\n\n - action-hidden-in-lib-usage\n\n\n - backdoor\n","modified":"2026-06-29T09:16:40.790774827Z","published":"2026-06-26T10:50:08Z","database_specific":{"malicious-packages-origins":[{"source":"kam193","modified_time":"2026-06-26T10:50:08.993957Z","sha256":"9e2d3483845391abac4b854096ffc1c7767818f9e2b02486d969ee2be0638dc9","id":"pypi/2026-06-inlifegram/inlifegram","import_time":"2026-06-26T11:54:37.154560125Z","versions":["2.1.2.8","2.1.2.9"]},{"ranges":[{"events":[{"introduced":"0"}],"type":"ECOSYSTEM"}],"source":"amazon-inspector","modified_time":"2026-06-29T08:09:41Z","import_time":"2026-06-29T09:10:17.212801108Z","id":"IN-MAL-2026-007779","sha256":"3975a0998bf76dddc25f0138b1d4b408bb06304b3203dc1e62e0110b2b56425f","versions":["2.1.2.8"]},{"ranges":[{"events":[{"introduced":"0"}],"type":"ECOSYSTEM"}],"sha256":"47e605deff389b5280d8c5eac7c01fbdb3f108eade075cb3fd54031b1a03842f","source":"amazon-inspector","id":"IN-MAL-2026-007780","import_time":"2026-06-29T09:10:17.319245844Z","modified_time":"2026-06-29T08:09:49Z","versions":["2.1.2.9"]}]},"references":[{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/inlifegram"},{"type":"PACKAGE","url":"https://pypi.org/project/InLifeGram/2.1.2.8/"},{"type":"PACKAGE","url":"https://pypi.org/project/InLifeGram/2.1.2.9/"}],"affected":[{"package":{"name":"inlifegram","ecosystem":"PyPI","purl":"pkg:pypi/inlifegram"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.1.2.8","2.1.2.9"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/inlifegram/MAL-2026-6516.json","cwes":[{"name":"Embedded Malicious Code","description":"The product contains code that appears to be malicious in nature.","cweId":"CWE-506"},{"name":"Embedded Malicious Code","description":"The product contains code that appears to be malicious in nature.","cweId":"CWE-506"}],"indicators":{"evidence_files":[{"path":"pyrogram/methods/utilities/start.py","sha256":"3910d7915068bcefd67734506b60996757640308ebe04c004e5f7143cf38e114","tlsh":"5a51200955269a73ad87465e58bfb0db5722dc07320e44b035bc936e5f0e63302fbe88"},{"tlsh":"6d42cfc3706093a85b8f3a50ded67292ad655710ae4f0d0f772c2ee2530ccd53a91eb9","sha256":"cf1b4cd158614272b0e41e4fa785550545a69ca93200300046557065d7d1f3a6","path":"pyrogram/methods/utilities/app.py"},{"path":"setup.py","sha256":"834bd1973106a39a5c567a07b8337d5a6107c2c64c257c5ca53af80f1d8d607f","tlsh":"8461334a8dc85ab51bc050c5350f588a9322e9673d4964c47bbd831f9f6ee3f027a17c"}],"package_integrity":[{"filename":"inlifegram-2.1.2.8.tar.gz","hashes":{"md5":"ab2e8b0ef42143278381cf20d9c5a303","sha256":"01862c3b77155d9672bcc88650df7274618c578ec5c28d6e4c382d87da7a0e4e","blake2b_256":"4b92a9b4814cdfde413d751e02b94e7cb7f5c6cc712f1ec0a69bfbda5c24a598"}}]}}}],"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"}]}