News · DiggingBeagle record

pystr-codec used Python startup hooks to launch a reported credential-stealing payload

An advisory identifies three malicious PyPI versions that activate through a .pth startup file. Reported propagation and destructive behavior belong to the malware design; verified infections remain unknown.

Published
Nov 2, 2026

The report

A GitHub malware advisory published November 1 identifies pystr-codec versions 0.1.0, 0.1.1 and 0.1.2 as malicious. Rather than waiting for a developer to call a risky function, the package contains a .pth file that Python processes during interpreter startup. The described chain launches obfuscated JavaScript through Bun and attempts credential collection, persistence, remote-command handling and propagation. These are source-analysis findings in the published report, not a census of successful infections. Review the advisory.

The startup location is the central trust boundary. A package installed as a dependency may execute before application code imports it explicitly. That defeats a review process based only on searching a project's normal Python call sites. The report suggests a possible relationship to the testmetest or Miasma package activity, but similarity of payload design does not prove a shared operator. The pystr-codec Case maintains that uncertainty.

Compromise investigation is not package removal alone

The advisory describes credential use and potentially destructive behavior when credentials stop working. It does not follow that every environment with the package installed reached every later stage. An affected installation should be investigated for startup execution, unexpected processes, network activity and credential exposure, with the malicious artifact removed and affected credentials rotated as appropriate. There is no supported safe version within the three listed releases.

The broader agent-security connection is supply-chain persistence: malicious code can modify agent instruction files and related development automation after the ordinary package-install boundary has already been crossed. Detecting the original Python package is necessary, but it does not establish what subsequent files or credentials remained unchanged.

Research behind this