MAL-2026-6245
Vulnerability from ossf_malicious_packages
Published
2026-06-20 18:47
Modified
2026-06-22 18:27
Summary
Malicious code in request-cache-py (PyPI)
Details

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

Source: amazon-inspector (eafb96e46544cb1351d26caf52bff79055bc205a1f8454737b677fff8fbc6fea)

request-cache-py impersonates the legitimate requests-cache HTTP caching library. On import request_cache_py, the package's __init__.py starts a background thread that harvests installer-side secrets and POSTs them to a hardcoded attacker Telegram bot.

Observed behaviors: - Reads private keys and credentials from ~/.ssh/ (id_rsa, id_ed25519, id_ecdsa, id_dsa), ~/.aws/credentials, ~/.aws/config, ~/.gitconfig, ~/.git-credentials, ~/.npmrc, ~/.pypirc, ~/.dockercfg, ~/.docker/config.json, plus gcloud and vscode settings. - Copies Chrome/Edge/Safari Login Data, Cookies, and History SQLite databases to /tmp and extracts saved logins, cookies, and browsing history (SELECT origin_url, username_value FROM logins; SELECT host_key, name, value, path FROM cookies). - Iterates os.environ and exfiltrates any variable whose name contains key, token, secret, password, api, or auth. - Posts the collected data to https://api.telegram.org/bot<redacted>/sendMessage with a fixed chat_id. The bot token and chat id are base64-split across pieces and reassembled at runtime to evade scanners. - Includes sandbox-evasion: _should_skip() aborts when CI, GITHUB_ACTIONS, TRAVIS, JENKINS_HOME, CIRCLECI, /.dockerenv, or hypervisor markers are present, restricting execution to real developer workstations. A ~/.cache/.pyrc marker suppresses repeat sends within 24 hours.

The combination — name impersonation of a popular library, import-time credential harvest from classic developer secret paths, browser database theft, env scraping, base64-obfuscated C2, sandbox evasion — is a deliberate supply-chain credential stealer targeting human developers.

Source: kam193 (d027c4b6379310432f96b48dc78c73ddf1346052c5ab16ea6ed4fe3fc0754d08)

During import, package exfiltrates browsers data, SSH keys and other credential files, env variables and other sensitive data.


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

Campaign: 2026-06-request-cache-py

Reasons (based on the campaign):

  • infostealer

  • exfiltration-env-variables

  • exfiltration-ssh-keys

  • impersonation

  • A Telegram webhook is used to send collected data.

  • exfiltration-browser-data

  • The package contains code to detect if it is running in a sandbox environment.

  • exfiltration-credentials

  • The malicious code is intentionally included in a dependency of the package

CWE
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • 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"
          },
          {
            "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"
          },
          {
            "cweId": "CWE-506",
            "description": "The product contains code that appears to be malicious in nature.",
            "name": "Embedded Malicious Code"
          }
        ],
        "indicators": {
          "evidence_files": [
            {
              "path": "request_cache_py/__init__.py",
              "sha256": "f3a42d1dc1e40084acca2668279d9b1ec9568b5ea2e14fb6da1b8f744e3e61c6",
              "tlsh": "b272b54626a8b452c383847f8c97e1127b1abd571a50a83c3cec46186fc8176d6f5ebc"
            },
            {
              "path": "setup.py",
              "sha256": "7d7188f77fc26ccb8f54495c5b3be1371c7eb4db5b78e050668ea1557a4c1389",
              "tlsh": "cf21f0670dc616f06af0844a553f1c06e8258b672600a8d779bd034d6ff3be3027613c"
            }
          ],
          "package_integrity": [
            {
              "filename": "request_cache_py-1.1.0.tar.gz",
              "hashes": {
                "blake2b_256": "d604aaa98bfa898675959af1a2c1ab6cf35343f74d9503998d89c2c5d69137d1",
                "md5": "c723b737df97419d935180cab0ed5062",
                "sha256": "1fa0f56e415c0b573ca5279e475e199c5d789761d743770be47cc576cdae0000"
              }
            }
          ]
        }
      },
      "package": {
        "ecosystem": "PyPI",
        "name": "request-cache-py"
      },
      "versions": [
        "1.0.0",
        "1.0.1",
        "1.0.2",
        "1.0.3",
        "1.0.4",
        "1.0.5",
        "1.0.6",
        "1.0.7",
        "1.0.8",
        "1.0.9",
        "1.1.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": [
        "analytics-collector.herokuapp.com"
      ],
      "urls": [
        "https://analytics-collector.herokuapp.com/events"
      ]
    },
    "malicious-packages-origins": [
      {
        "id": "pypi/2026-06-request-cache-py/request-cache-py",
        "import_time": "2026-06-20T19:34:59.735458632Z",
        "modified_time": "2026-06-20T18:49:53.485406Z",
        "sha256": "d027c4b6379310432f96b48dc78c73ddf1346052c5ab16ea6ed4fe3fc0754d08",
        "source": "kam193",
        "versions": [
          "1.0.0",
          "1.0.1",
          "1.0.2",
          "1.0.3",
          "1.0.4",
          "1.0.5",
          "1.0.6",
          "1.0.7",
          "1.0.8",
          "1.0.9",
          "1.1.0"
        ]
      },
      {
        "id": "IN-MAL-2026-007157",
        "import_time": "2026-06-22T18:25:29.643101092Z",
        "modified_time": "2026-06-22T18:24:25Z",
        "sha256": "4ec4eb5987160de24832dd35975645b14904ca353b22b35740e58aa833ea0b81",
        "source": "amazon-inspector",
        "versions": [
          "1.1.0"
        ]
      },
      {
        "id": "IN-MAL-2026-007158",
        "import_time": "2026-06-22T18:25:29.81285396Z",
        "modified_time": "2026-06-22T18:24:26Z",
        "sha256": "81fce5abd64051b0a0b385f15f498a2dbde54baf0b2b5cc58a4948b2485f013a",
        "source": "amazon-inspector",
        "versions": [
          "1.0.0"
        ]
      },
      {
        "id": "IN-MAL-2026-007156",
        "import_time": "2026-06-22T18:25:29.560400349Z",
        "modified_time": "2026-06-22T18:24:25Z",
        "sha256": "9c927aa5d62f6f7fa19755c9b10a85001368f6ffa77670da9dccddd806c7d670",
        "source": "amazon-inspector",
        "versions": [
          "1.0.7"
        ]
      },
      {
        "id": "IN-MAL-2026-007159",
        "import_time": "2026-06-22T18:25:29.921571037Z",
        "modified_time": "2026-06-22T18:24:30Z",
        "sha256": "eafb96e46544cb1351d26caf52bff79055bc205a1f8454737b677fff8fbc6fea",
        "source": "amazon-inspector",
        "versions": [
          "1.0.8"
        ]
      },
      {
        "id": "IN-MAL-2026-007160",
        "import_time": "2026-06-22T18:25:30.106202738Z",
        "modified_time": "2026-06-22T18:24:31Z",
        "sha256": "1a042aecdbbad9d841817b51d6d6f9dde1604ead6fb89a9875318a90cdcf3e7a",
        "source": "amazon-inspector",
        "versions": [
          "1.0.3"
        ]
      },
      {
        "id": "IN-MAL-2026-007155",
        "import_time": "2026-06-22T18:25:29.488875576Z",
        "modified_time": "2026-06-22T18:24:23Z",
        "sha256": "3abe06cfd4bc42ce70a746ecbccfcb29e093f620978448c670ab66f0076bc540",
        "source": "amazon-inspector",
        "versions": [
          "1.0.4"
        ]
      }
    ]
  },
  "details": "\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (eafb96e46544cb1351d26caf52bff79055bc205a1f8454737b677fff8fbc6fea)\nrequest-cache-py impersonates the legitimate requests-cache HTTP caching library. On `import request_cache_py`, the package\u0027s `__init__.py` starts a background thread that harvests installer-side secrets and POSTs them to a hardcoded attacker Telegram bot.\n\nObserved behaviors:\n- Reads private keys and credentials from `~/.ssh/` (`id_rsa`, `id_ed25519`, `id_ecdsa`, `id_dsa`), `~/.aws/credentials`, `~/.aws/config`, `~/.gitconfig`, `~/.git-credentials`, `~/.npmrc`, `~/.pypirc`, `~/.dockercfg`, `~/.docker/config.json`, plus gcloud and vscode settings.\n- Copies Chrome/Edge/Safari `Login Data`, `Cookies`, and `History` SQLite databases to `/tmp` and extracts saved logins, cookies, and browsing history (`SELECT origin_url, username_value FROM logins`; `SELECT host_key, name, value, path FROM cookies`).\n- Iterates `os.environ` and exfiltrates any variable whose name contains `key`, `token`, `secret`, `password`, `api`, or `auth`.\n- Posts the collected data to `https://api.telegram.org/bot\u003credacted\u003e/sendMessage` with a fixed `chat_id`. The bot token and chat id are base64-split across pieces and reassembled at runtime to evade scanners.\n- Includes sandbox-evasion: `_should_skip()` aborts when `CI`, `GITHUB_ACTIONS`, `TRAVIS`, `JENKINS_HOME`, `CIRCLECI`, `/.dockerenv`, or hypervisor markers are present, restricting execution to real developer workstations. A `~/.cache/.pyrc` marker suppresses repeat sends within 24 hours.\n\nThe combination \u2014 name impersonation of a popular library, import-time credential harvest from classic developer secret paths, browser database theft, env scraping, base64-obfuscated C2, sandbox evasion \u2014 is a deliberate supply-chain credential stealer targeting human developers.\n\n## Source: kam193 (d027c4b6379310432f96b48dc78c73ddf1346052c5ab16ea6ed4fe3fc0754d08)\nDuring import, package exfiltrates browsers data, SSH keys and other credential files, env variables and other sensitive data.\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2026-06-request-cache-py\n\n\nReasons (based on the campaign):\n\n\n - infostealer\n\n\n - exfiltration-env-variables\n\n\n - exfiltration-ssh-keys\n\n\n - impersonation\n\n\n - A Telegram webhook is used to send collected data.\n\n\n - exfiltration-browser-data\n\n\n - The package contains code to detect if it is running in a sandbox environment.\n\n\n - exfiltration-credentials\n\n\n - The malicious code is intentionally included in a dependency of the package\n",
  "id": "MAL-2026-6245",
  "modified": "2026-06-22T18:27:30Z",
  "published": "2026-06-20T18:47:50Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://bad-packages.kam193.eu/pypi/package/request-cache-py"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/request-cache-py/1.1.0/"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/request-cache-py/1.0.0/"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/request-cache-py/1.0.7/"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/request-cache-py/1.0.8/"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/request-cache-py/1.0.3/"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/request-cache-py/1.0.4/"
    }
  ],
  "schema_version": "1.7.4",
  "summary": "Malicious code in request-cache-py (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…

Detection rules are retrieved from Rulezet.

Loading…

Loading…