pystr-codec (PyPI) · Malicious Code
Affects pystr-codecSource GCVE Database
Malicious package : remove pystr-codec and rotate any secrets on hosts that installed it.
Data as of 1 Nov 2026, 01:55 UTC
Malicious package
Published to PyPI · OSV MAL-2026-18432
What to do
Remove pystr-codec from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIpystr-codec | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
The pystr-codec package on PyPI contains malicious code that executes on every Python startup. It runs obfuscated JavaScript via a Bun engine to exfiltrate credentials to a public GitHub repository, establish persistence, accept remote commands, spread using stolen credentials, and perform destructive actions if credentials become invalid. This malware is linked to the Miasma-family worm.