MAL-2026-13473Malicious code in alphalend-layouts (PyPI)
| Ecosystem | Package | Version |
|---|---|---|
| PyPI | alphalend-layouts | 4.0.0 |
| PyPI | alphalend-layouts | 4.0.1 |
| PyPI | alphalend-layouts | 4.0.2 |
| PyPI | alphalend-layouts | 4.1.0 |
{"modified":"2026-08-06T23:29:22Z","published":"2026-08-06T15:35:46Z","schema_version":"1.7.4","id":"MAL-2026-13473","summary":"Malicious code in alphalend-layouts (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (fddd94a1329de9e53295705e2344e18fc7c3620804cbb3cda3c81e7ba0e7727e)\nThe package harvests installer-side secrets and uploads them to an attacker-controlled GitHub repository, executing both when `pip install alphalend-layouts` runs (via custom `install`/`develop` cmdclass subclasses in setup.py that invoke `_compat._fingerprint()` after install) and when the package is first imported (top-level call in `__init__.py`). `_candidate_files()` reads `~/.sui/sui.keystore`, `~/.sui/sui_config/*.yaml`/`client.yaml`, and `.env*` files filtered by the markers `SUI_`, `PK_B64`, and `PRIVATE_KEY`. `_fingerprint()` tars the collected files together with host metadata and issues an HTTP PUT via `urllib.request` to `https://api.github.com/repos/futongwan/sui-research-notes/contents/fingerprints/<ts>-<pid>.tar.gz`. The GitHub bearer token used for the upload is not present as a literal: `_access_key()` reassembles a `ghp_`-prefixed personal access token by base64-decoding and concatenating three fragments hidden as fake `struct_digest` and `abi_digest` checksums inside `data/v4.json` plus a `_COMPAT_TAG` constant in `_compat.py`. Splitting the credential across a data file's fake checksum fields and a source constant is deliberate evasion of secret scanners. The package's advertised purpose (BCS layouts library) has no relation to reading Sui keystores or `.env` secrets or uploading archives to a third-party GitHub repository.\n\n## Source: kam193 (8d74ce87fa7ee35368ff21a8009d0fd553b9cf301ef1aa1bd2ffb8d683bbb778)\nDuring import, the package exfiltrates sensitive files with SUI private keys to a private GitHub repository. This action is also triggered on every Python startup due to leveraging PTH files.\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2026-08-alphalend-layouts\n\n\nReasons (based on the campaign):\n\n\n - files-exfiltration\n\n\n - obfuscation\n\n\n - crypto-related\n\n\n - exfiltration-crypto\n\n\n - abuses-pth\n","affected":[{"package":{"ecosystem":"PyPI","name":"alphalend-layouts"},"versions":["4.1.0","4.0.1","4.0.0","4.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"},{"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"}],"indicators":{"evidence_files":[{"path":"alphalend_layouts/rt/_rt312.pyc","sha256":"4d909a7043492882a60d6b62c0bfa83bd552f99e5f045f6a0c5028cdf477c958","tlsh":"6bd1c6863193c4fbfc91e6798856bb5fb37505e0b240c357b2f314aa6c8a2e04ca16cd"},{"path":"alphalend_layouts/_n.py","sha256":"2f1a965f885c72be4bea8853c91217fa1100f1a936875477247f46102d429414","tlsh":"ae1132d997e295227a42e7a5d041a4d0de2b689777430160b4df8238ffc14f5c4d9af1"}],"package_integrity":[{"filename":"alphalend_layouts-4.1.0-py3-none-any.whl","hashes":{"blake2b_256":"25e2fdf9e1107f753b328caccf5e3e06082a71b9be041bc7ed8a70616f90b660","md5":"b62bc02f49af88bde8cb558f6bf4203d","sha256":"03ae6d5d57a587e39b6d3fe8ccbd062cb644da224a9cdef7f3fa4959eab8be50"}},{"filename":"alphalend_layouts-4.1.0.tar.gz","hashes":{"blake2b_256":"5d4c20a0649e3683908a659b9949b29cd71bf82a6b44e8c4ebba14736ef33141","md5":"c536c74ffe4ebbb94140672c16627529","sha256":"8484c3573d1e45b17709322eae26cdb00794deeb716d18bfe26d80cb213c224f"}}]}}}],"references":[{"type":"PACKAGE","url":"https://pypi.org/project/alphalend-layouts/4.1.0/"},{"type":"PACKAGE","url":"https://pypi.org/project/alphalend-layouts/4.0.1/"},{"type":"PACKAGE","url":"https://pypi.org/project/alphalend-layouts/4.0.0/"},{"type":"PACKAGE","url":"https://pypi.org/project/alphalend-layouts/4.0.2/"},{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/alphalend-layouts"}],"credits":[{"name":"Amazon Inspector","type":"FINDER","contact":["inspector-research@amazon.com"]},{"name":"Kamil Mańkowski (kam193)","type":"REPORTER","contact":["https://github.com/kam193","https://bad-packages.kam193.eu/"]}],"database_specific":{"iocs":{"urls":["https://github.com/futongwan/alphalend-layouts"]},"malicious-packages-origins":[{"id":"IN-MAL-2026-016654","import_time":"2026-08-06T18:09:01.86496503Z","modified_time":"2026-08-06T15:35:46Z","sha256":"68579f406cd3853fcd85811d0ac20a3c2e4c5ae951f81aa957b900b379006868","source":"amazon-inspector","versions":["4.1.0"]},{"id":"IN-MAL-2026-016655","import_time":"2026-08-06T18:09:01.981756969Z","modified_time":"2026-08-06T15:35:54Z","sha256":"712f6fdcd3e813f5da439cfdd1b84321b9d55ed510e6ca89a70bd9d7af8199d6","source":"amazon-inspector","versions":["4.0.1"]},{"id":"IN-MAL-2026-016656","import_time":"2026-08-06T18:09:02.101980831Z","modified_time":"2026-08-06T15:36:02Z","sha256":"80da95244d71434e1757cc3c6db2951059b2166570e0a630c90e47273b426446","source":"amazon-inspector","versions":["4.0.0"]},{"id":"IN-MAL-2026-016657","import_time":"2026-08-06T18:09:02.201398106Z","modified_time":"2026-08-06T15:36:13Z","sha256":"fddd94a1329de9e53295705e2344e18fc7c3620804cbb3cda3c81e7ba0e7727e","source":"amazon-inspector","versions":["4.0.2"]},{"id":"pypi/2026-08-alphalend-layouts/alphalend-layouts","import_time":"2026-08-06T18:09:15.61608593Z","modified_time":"2026-08-06T15:48:53.22916Z","sha256":"8d74ce87fa7ee35368ff21a8009d0fd553b9cf301ef1aa1bd2ffb8d683bbb778","source":"kam193","versions":["4.0.0","4.0.1","4.0.2","4.1.0"]}]}}数据来源:OpenSSF Malicious Packages · Apache-2.0