mal-2026-14587
Vulnerability from ossf_malicious_packages
Published
2026-08-28 09:55
Modified
2026-08-29 12:25
Summary
Malicious code in pygame-renderkit (PyPI)
Details

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

Source: amazon-inspector (fdef1a055b3059d56581d5c0d33538e7799cfde5e42d596eb50094d06d984f54)

setup.py registers a custom install command that forks a daemonized child during pip install and executes a base64-encoded Python payload via exec(compile(...)). The decoded payload connects to a hardcoded C2 host at 5uj0a8ziyu.localto.net:3900 and provides an interactive reverse shell by duplicating the socket onto stdin/stdout/stderr of /bin/bash (via pty.spawn) or /bin/sh -i, with a 15-second reconnect loop. It also enumerates environment variables matching API, TOKEN, KEY, SECRET, PASS, CRED, AUTH, AWS, AZURE, GCP, OPENAI, ANTHROPIC, and MANUS, reads /etc/passwd, /etc/sudoers, /etc/shadow, ~/.bash_history, and /opt/.manus/current/config, and sends the collected data over TCP to the same host framed with [EXFIL]/[ENDEXFIL] markers. Persistence is established by writing /tmp/.rk_recon.py, installing a per-minute crontab entry, dropping a renderkit.service systemd user unit with Restart=always, and writing /etc/sudoers.d/.renderkit granting the current user NOPASSWD: ALL. The payload is stored as a base64-encoded template with %%HOST%%/%%PORT%% placeholders and the installer forks with start_new_session=True to hide from pip output. The package presents as a pygame utility; none of this behavior matches that stated purpose.

Source: kam193 (5856daeb3070a9b2a6ffc42d8999ff49c63706ccb27ee683e5fcc4ff175f78f9)

During installation, the package attempts to exfiltrate sensitive environment variables and files, establish persistence and open reverse shell.


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

Campaign: 2026-08-pygame-renderkit

Reasons (based on the campaign):

  • persistence

  • The package overrides the install command in setup.py to execute malicious code during installation.

  • The package contains code to create a reverse shell, allowing an attacker to execute any commands on the victim's machine.

  • files-exfiltration

  • exfiltration-env-variables

CWE
  • CWE-506 - The product contains code that appears to be malicious in nature.

{
  "affected": [
    {
      "database_specific": {
        "cwes": [
          {
            "cweId": "CWE-506",
            "description": "The product contains code that appears to be malicious in nature.",
            "name": "Embedded Malicious Code"
          }
        ],
        "indicators": {
          "evidence_files": [
            {
              "path": "setup.py",
              "sha256": "83c3b28f0de6d30aceaf2fac3b115a37590aae1414484cc23a26999a5b485500",
              "tlsh": "86f1b696c9891134d7d38677201a9541169bb4279f0768b47ffc8340dfce37911b93ba"
            }
          ],
          "package_integrity": [
            {
              "filename": "pygame_renderkit-1.2.0-py3-none-any.whl",
              "hashes": {
                "blake2b_256": "4c8dd740c2ea9776c89c059449e28d532c505823e02b9ad8265c320fc17bdc36",
                "md5": "88fd83e2478825d7f07f68f7bf23fe7e",
                "sha256": "3dfb0db9f896161286b54dcd498f487caa79d5cee1499654e84991dff73ac2e6"
              }
            },
            {
              "filename": "pygame_renderkit-1.2.0.tar.gz",
              "hashes": {
                "blake2b_256": "92b64748449078ce86e6f7d88fbb56965078d39bc41e852c6b34776373904f65",
                "md5": "2159afa43a753fea6577d1cfcedec980",
                "sha256": "2bea5d7ee5dd2eef24485a804bc0badc240157b14a67e5f3c6e3765eb6675a69"
              }
            }
          ]
        }
      },
      "package": {
        "ecosystem": "PyPI",
        "name": "pygame-renderkit"
      },
      "versions": [
        "1.2.0"
      ]
    }
  ],
  "credits": [
    {
      "contact": [
        "inspector-research@amazon.com"
      ],
      "name": "Amazon Inspector",
      "type": "FINDER"
    },
    {
      "contact": [
        "https://github.com/kam193",
        "https://bad-packages.kam193.eu/"
      ],
      "name": "Kamil Ma\u0144kowski (kam193)",
      "type": "REPORTER"
    }
  ],
  "database_specific": {
    "iocs": {
      "domains": [
        "5uj0a8ziyu.localto.net"
      ]
    },
    "malicious-packages-origins": [
      {
        "id": "pypi/2026-08-pygame-renderkit/pygame-renderkit",
        "import_time": "2026-08-28T10:38:59.563679787Z",
        "modified_time": "2026-08-28T09:55:47.226508Z",
        "sha256": "5856daeb3070a9b2a6ffc42d8999ff49c63706ccb27ee683e5fcc4ff175f78f9",
        "source": "kam193",
        "versions": [
          "1.2.0"
        ]
      },
      {
        "id": "IN-MAL-2026-018804",
        "import_time": "2026-08-28T19:33:50.163054566Z",
        "modified_time": "2026-08-28T16:43:31Z",
        "sha256": "fdef1a055b3059d56581d5c0d33538e7799cfde5e42d596eb50094d06d984f54",
        "source": "amazon-inspector",
        "versions": [
          "1.2.0"
        ]
      },
      {
        "id": "pypi/2026-08-pygame-renderkit/pygame-renderkit",
        "import_time": "2026-08-29T12:23:15.012408983Z",
        "modified_time": "2026-08-28T09:55:47.226508Z",
        "sha256": "039ea05d12048144a31dfde021c4b725fbceb2634d816cca4a97776bc2c55140",
        "source": "kam193",
        "versions": [
          "1.2.0"
        ]
      }
    ]
  },
  "details": "\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (fdef1a055b3059d56581d5c0d33538e7799cfde5e42d596eb50094d06d984f54)\nsetup.py registers a custom install command that forks a daemonized child during pip install and executes a base64-encoded Python payload via exec(compile(...)). The decoded payload connects to a hardcoded C2 host at 5uj0a8ziyu.localto.net:3900 and provides an interactive reverse shell by duplicating the socket onto stdin/stdout/stderr of /bin/bash (via pty.spawn) or /bin/sh -i, with a 15-second reconnect loop. It also enumerates environment variables matching API, TOKEN, KEY, SECRET, PASS, CRED, AUTH, AWS, AZURE, GCP, OPENAI, ANTHROPIC, and MANUS, reads /etc/passwd, /etc/sudoers, /etc/shadow, ~/.bash_history, and /opt/.manus/current/config, and sends the collected data over TCP to the same host framed with [EXFIL]/[ENDEXFIL] markers. Persistence is established by writing /tmp/.rk_recon.py, installing a per-minute crontab entry, dropping a renderkit.service systemd user unit with Restart=always, and writing /etc/sudoers.d/.renderkit granting the current user NOPASSWD: ALL. The payload is stored as a base64-encoded template with %%HOST%%/%%PORT%% placeholders and the installer forks with start_new_session=True to hide from pip output. The package presents as a pygame utility; none of this behavior matches that stated purpose.\n\n## Source: kam193 (5856daeb3070a9b2a6ffc42d8999ff49c63706ccb27ee683e5fcc4ff175f78f9)\nDuring installation, the package attempts to exfiltrate sensitive environment variables and files, establish persistence and open reverse shell.\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2026-08-pygame-renderkit\n\n\nReasons (based on the campaign):\n\n\n - persistence\n\n\n - The package overrides the install command in setup.py to execute malicious code during installation.\n\n\n - The package contains code to create a reverse shell, allowing an attacker to execute any commands on the victim\u0027s machine.\n\n\n - files-exfiltration\n\n\n - exfiltration-env-variables\n",
  "id": "MAL-2026-14587",
  "modified": "2026-08-29T12:25:04.083227376Z",
  "published": "2026-08-28T09:55:47Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://bad-packages.kam193.eu/pypi/package/pygame-renderkit"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/pygame-renderkit/1.2.0/"
    }
  ],
  "schema_version": "1.7.4",
  "summary": "Malicious code in pygame-renderkit (PyPI)"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…