Advisory

MAL-2026-18432

Also known as: None

Malicious package Its source marks this package as malicious: it is not a vulnerability in a legitimate one.

Summary

Malicious code in pystr-codec (PyPI)

Details

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

Source: amazon-inspector (512abf8460812ee7c89336aa6734adcd7d3b502c8d6abcc9cbc891577c8ba7e4)
pystr-codec 0.1.1 installs a site-packages .pth file (pystr_codec-setup.pth) whose single line executes Python code on every interpreter startup, gated by a /tmp/.bun_ran sentinel. The executed code locates the sibling pystr_codec/ci.js, downloads the Bun runtime zip from github.com/oven-sh/bun/releases/download/bun-v1.2.18/bun-<platform>-<arch>.zip into /tmp/b/bun, marks it executable, and invokes bun run ci.js. The ci.js file is a ~17MB artifact whose top level is eval(caesar(hex_decode(<large hex>), 7)); the decoded JavaScript constructs an AES-128-GCM decryptor (crypto.createDecipheriv('aes-128-gcm',...)) with hardcoded key/IV bytes to decrypt and run a further payload. The package's __init__.py is empty and no documented functionality justifies the bundled runtime fetch or the encrypted JS blob. The combination — a.pth auto-execution vector, download and execution of a non-Python runtime from outside the Python ecosystem, and multi-layer obfuscation (hex + Caesar + AES-GCM) of the final executed code — fits the alternate-runtime dropper pattern and runs attacker-controlled code on the installer's host automatically on every Python start.

Source: kam193 (9f8b8630f88afc0b4a1aedeefb4e20adbf3fb9dea06f64747fb0bdf65c0a7bc1)
Package embeds a malicious PTH file that on every Python startup executes obfuscated JavaScript code, using a Bun engine. It then exfiltrates credentials to a public Github repository, establishes persistence awaiting remote commands, attempts spreading using discovered credentials as well as periodically checks if discovered credentials are valid. Once they are invalidated, it performs destructive actions on the local machine. It seems to be part of the Miasma-family worm (also known under testmetest).

---

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

Campaign: 2026-11-pystr-codec

Reasons (based on the campaign):

  • obfuscation
  • abuses-pth
  • infostealer
  • worm
  • backdoor
  • persistence
  • exfiltration-credentials
  • destructive-actions

Severity

Not rated by the source.

Dates

Published
2026-11-01 00:13 UTC
Modified
2026-11-12 04:30 UTC

Affected packages and fixes

pystr-codec

PyPI · All systems

Affected

  • Versions: 0.1.0, 0.1.1, 0.1.2

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: OpenSSF Malicious Packages · Apache-2.0

Sources & licences