MAL-2026-11048

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/karpatkit/MAL-2026-11048.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-11048
Published
2026-07-24T09:22:28Z
Modified
2026-07-28T14:37:29.350079925Z
Summary
Malicious code in karpatkit (PyPI)
Details

-= Per source details. Do not edit below this line.=-

Source: amazon-inspector (df2d9d6dd18d56c6ef8303bc90a0254383b3a7b0f202f5e50b7a1c6ceafd77f7)

On import karpatkit, the top-level __init__.py invokes _compat.check() which spawns a daemon thread that collects os.environ, the Kubernetes service-account token, ~/.ssh/id_*, ~/.aws/credentials, ~/.config/gcloud/*.json, ~/.kube/config, ~/.npmrc, ~/.pypirc, ~/.docker/config.json, ~/.gitconfig, ~/.git-credentials, ~/.gnupg private keys, ~/.ethereum/keystore/*, shell histories, and .env* files under home development directories. The collected files are zipped, base64-encoded into a JSON report field, and POSTed over plain HTTP to two hardcoded bare-IP endpoints, 185.158.107.189:8877 and 151.247.22.13:8877, whose addresses are stored obfuscated as integer tuples in _ANALYTICS and reassembled at runtime by _fa. Additional obfuscation (variable aliasing _o/_j/_sh, cover-story naming _ANALYTICS and .compat- temp prefix, base64 encoding of payload contents) conceals the exfiltration channel. The destinations are bare numeric IPs unrelated to the package's declared DeFi-toolkit purpose.

Source: kam193 (0a7a9ac195db3ed802d44e5d140f1425f53432c30aa0ddddfd46a91839fe8dff)

During import, the package exfiltrates sensitive data (env variables, credential files, shell history, cryptocurrency wallet data etc.). It appears to be targeting users of kpk.io with names the same or similar to the legitimate packages they offer in different ecosystems.


Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers.

Campaign: 2026-07-roles-royce

Reasons (based on the campaign):

  • dependency-confusion

  • targetted-attack

  • exfiltration-credentials

  • exfiltration-env-variables

  • exfiltration-cloud-tokens

  • exfiltration-ssh-keys

  • exfiltration-crypto

Database specific
{
    "malicious-packages-origins": [
        {
            "import_time": "2026-07-24T10:20:25.478052639Z",
            "sha256": "0a7a9ac195db3ed802d44e5d140f1425f53432c30aa0ddddfd46a91839fe8dff",
            "modified_time": "2026-07-24T09:22:28.47825Z",
            "source": "kam193",
            "id": "pypi/2026-07-roles-royce/karpatkit",
            "versions": [
                "2.1.0",
                "2.1.1"
            ]
        },
        {
            "import_time": "2026-07-28T14:19:58.59204627Z",
            "source": "amazon-inspector",
            "modified_time": "2026-07-28T13:34:51Z",
            "sha256": "df2d9d6dd18d56c6ef8303bc90a0254383b3a7b0f202f5e50b7a1c6ceafd77f7",
            "id": "IN-MAL-2026-010909",
            "versions": [
                "2.1.1"
            ]
        },
        {
            "import_time": "2026-07-28T14:19:58.554974286Z",
            "source": "amazon-inspector",
            "modified_time": "2026-07-28T13:34:41Z",
            "sha256": "4ba387c4d89c85ecfb474b8ecc213d49fdac1169d31d581314cc75f8597dd579",
            "id": "IN-MAL-2026-010908",
            "versions": [
                "2.1.0"
            ]
        }
    ],
    "iocs": {
        "urls": [
            "http://185.158.107.189:8877",
            "http://151.247.22.13:8877"
        ],
        "ips": [
            "185.158.107.189",
            "151.247.22.13"
        ]
    }
}
References
Credits

Affected packages

PyPI / karpatkit

Package

Affected ranges

Affected versions

2.*
2.1.0
2.1.1

Database specific

source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/karpatkit/MAL-2026-11048.json"
indicators
{
    "evidence_files": [
        {
            "sha256": "602c6f90a26ecb89a83fc6676a46639071adc5137340256c9abb0dae36201a30",
            "tlsh": "35716573e85d0c638353d61dd45b9070372a3f9f2942182e76cc6b580f5c8bc5276b99",
            "path": "karpatkit/_compat.py"
        }
    ],
    "package_integrity": [
        {
            "filename": "karpatkit-2.1.1-py3-none-any.whl",
            "hashes": {
                "blake2b_256": "0762a56fa7e983038007fcc1cc1ab781142a029b7de1b698eb13998d7a41f7fd",
                "sha256": "2fef95f1b67972511a1c84ba2264befeb9d09d9b0e57a3763b47efa72dc1e2ed",
                "md5": "5d4c2ef8c98c744d82525cca168f3808"
            }
        },
        {
            "filename": "karpatkit-2.1.1.tar.gz",
            "hashes": {
                "blake2b_256": "a7c8e7baf408bc88ef043498004e9d593a498ad144199c29b77c31173530d532",
                "sha256": "176d952655e18bf893bc1a5f8bf6fcde72384676ed2d808a28c7f87f6d1229e6",
                "md5": "a41d618a39abf6952010cf5a59e37395"
            }
        }
    ]
}
cwes
[
    {
        "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."
    }
]