{"id":"MAL-2026-6381","summary":"Malicious code in ditenv (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (f0a52dbba9abeff2c606bcbc862027da259fcbd3938c827abfdbdb06ba801ecb)\nsetup.py overrides the install and egg_info commands with a RunCommand() class that fires unconditionally on `pip install` or `pip download`. The override reads the entire process environment via `os.environ`, serializes every key=value pair, captures the output of `ps -elf`, and POSTs the combined payload over plaintext HTTP via curl to a hardcoded interactsh/OAST subdomain (gjampdwmdjmppwedtkpbbdkq05f6iiz6r.oast.fun). On developer machines and CI runners, the captured environment routinely contains AWS_SECRET_ACCESS_KEY, GH_TOKEN, NPM_TOKEN, PYPI_TOKEN, and similar credentials, all of which are leaked to an arbitrary attacker-controlled callback host. The package name is suggestive of a `dotenv` typosquat and the README self-identifies as a proof-of-concept; a comment claims the code is 'for research not for doing any harmful activity', but the cover story does not change the fact that any installer is subjected to live credential theft.\n\n## Source: kam193 (6d0048d35301edad3a673cfd44c244a805586b25d3027758738aa8939099f1cc)\nDuring installation, the package exfiltrates env variables\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2026-06-ip-rotat\n\n\nReasons (based on the campaign):\n\n\n - The package overrides the install command in setup.py to execute malicious code during installation.\n\n\n - exfiltration-env-variables\n\n\n - typosquatting\n","modified":"2026-06-25T03:31:24.490012905Z","published":"2026-06-24T06:41:09Z","database_specific":{"iocs":{"domains":["gjampdwmdjmppwedtkpbbdkq05f6iiz6r.oast.fun"]},"malicious-packages-origins":[{"sha256":"6d0048d35301edad3a673cfd44c244a805586b25d3027758738aa8939099f1cc","import_time":"2026-06-24T07:47:34.49949455Z","id":"pypi/2026-06-ip-rotat/ditenv","modified_time":"2026-06-24T06:41:09.531667Z","versions":["0.0.1"],"source":"kam193"},{"source":"amazon-inspector","sha256":"f0a52dbba9abeff2c606bcbc862027da259fcbd3938c827abfdbdb06ba801ecb","import_time":"2026-06-25T03:13:55.59686211Z","id":"IN-MAL-2026-007454","modified_time":"2026-06-25T01:52:38Z","versions":["0.0.1"]}]},"references":[{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/ditenv"},{"type":"PACKAGE","url":"https://pypi.org/project/ditenv/0.0.1/"}],"affected":[{"package":{"name":"ditenv","ecosystem":"PyPI","purl":"pkg:pypi/ditenv"},"versions":["0.0.1"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/ditenv/MAL-2026-6381.json","cwes":[{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."}],"indicators":{"evidence_files":[{"path":"setup.py","sha256":"36f6db5f6abbdde271d1b8b35cfff8296b632161f6b560855aafc1eac934fce8","tlsh":"06316207e0bf19291ec344a0558f03959bc0e3a32f6431fab1fc29191f0b129113b8af"},{"sha256":"15b4bdf3da6546bc391d6629e1b6a0fa9d17d037a275392dd16191ca312a51ed","tlsh":"6341873f8b9493341a211993355e62d4cb0f78bab6b184d47c7d09a5b217dae80333d2","path":"README.md"}],"package_integrity":[{"filename":"ditenv-0.0.1-py3-none-any.whl","hashes":{"sha256":"47e3f46d84b29815c49496ff52db72f8539a72b2dbc22281d763c705eedf222e","blake2b_256":"1cf02d2c7ba7ec5203186db3de714deeecae54a19a0bbe88432c81c4ac1cc2fe","md5":"a0466995f12bc0b803d4b86f079a9880"}},{"hashes":{"sha256":"7ce72def41d507c426f8c0460e2ad7af4eb5e7dfa9dcc6f4823ccea5448f289a","blake2b_256":"0cb7b3a7b74888c551ef8e6317c199514ddff18bb215f906bc68ee67e9d7c921","md5":"c9cfe54ecbfa2011c773fca517ac8e8a"},"filename":"ditenv-0.0.1.tar.gz"}]}}}],"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"}]}