Launch Week Day 1: Announcing Security Design Review
CRITICAL PyPI Malware

Malicious code in pantheon-toolsets (PyPI)

MAL-2026-5277

Published · Modified

Description


__

Source: amazon-inspector (a3f2d24843d0caf23a36f07f7bd7b3adb7163463404856654f1745c7e75017be)

The wheel installs pantheon_toolsets-setup.pth, which Python automatically executes at every interpreter startup (before any user import). The.pth contains a single obfuscated line using single-letter underscore-prefixed identifiers (_O, _T, _G, _o, _s, _u, _b, _a, _m, _z,...) and wraps the payload inside exec() of a string literal — a shape that has no legitimate use in a.pth file (which is normally limited to plain import statements / sys.path entries). The exec'd code: (1) checks a sentinel /tmp/.bun_ran to ensure one-shot execution, (2) downloads the Bun JavaScript runtime from https://github.com/oven-sh/bun/releases/download/bun-v1.3.13/bun-{platform}-{arch}.zip into /tmp/b/bun, (3) glob-searches the install tree for any _index.js file, and (4) runs it via subprocess with bun run <globbed_index.js>. The package is advertised as a Python AI-agent toolset and has no documented need for an alternate JavaScript runtime. The globbed _index.js payload is not declared in the wheel manifest and is fetched/staged opaquely, so the bytes ultimately executed are not auditable from the package metadata. Additional tampering fingerprint: the 0.5.5 RECORD references a 0.5.4 dist-info directory and lists its own RECORD with the empty-string SHA-256 and zero size, consistent with a malicious file appended to an otherwise legitimate build by someone with publish credentials. Installing this package causes arbitrary attacker-stageable code to run with the user's privileges every time python is invoked.

Source: kam193 (9c9711927907f09a0ef2b146d3aba3b8a06197b9af3f639d579015cdab7c0d5d)

Versions 0.5.5, 0.5.6 were compromised.

Compromised packages start an obfuscated infostealer. The infostealer is a heavily obfuscated JavaScript code executed using Bun runtime on Python startup. It collectes all kinds of sensitive data, including API keys, credentials to package repositories, cryptocurrency assets, password manager data. Infostealer actively queries online services to collect additional secrets as well as attempts to gain persistence and spread further by publishing infected packages using collected credentials. Data are exfiltrated likely using Github. The code seems to threaten to wipe the user's data if it detects invalid GitHub tokens. Cleanup should be done with caution.

It seems to be related to the recent Mini Shai Hulud campaign.


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

Campaign: 2026-06-compr-woodpecker

Reasons (based on the campaign):

  • compromised-package

  • exfiltration-env-variables

  • exfiltration-cloud-tokens

  • exfiltration-credentials

  • abuses-pth

  • obfuscation

  • infostealer

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

  • exfiltration-crypto

  • files-exfiltration

  • destructive-actions

Ready to move

Start Securing

Free, no credit card | First findings in minutes