2026-07-14 · view entry permalink →
Cisco Talos maps the full taxonomy of Python-package build-time and import-time code execution ("The Serpent's Tongue")
Cisco Talos published a comprehensive technical survey of code-execution paths across the Python packaging lifecycle, repository hosting (PyPI, version-control, custom servers), source (sdist) and wheel distribution formats, and installation into virtual or system-wide environments, split into two classes and assessed for persistence (Cisco Talos, 2026-07-14). Build-hook abuses fire code during installation: setup.py executes automatically on install or download, so a malicious command class runs arbitrary code as a transient one-shot. The more consequential class is persistence: a .pth path-configuration file dropped into site-packages is executed on every subsequent Python invocation, and site-hook modules (sitecustomize.py/usercustomize.py) and PYTHONPATH hijacking behave the same way, the payload survives well beyond install time. Talos ties the .pth technique directly to TeamPCP's supply-chain compromise of the litellm package and the import-time __init__.py payload to its lightning compromise, part of a documented run of TeamPCP supply-chain waves. The piece closes on defensive measures, dependency auditing (pip-audit), hashed lock files, install-time controls and a dependency-cooldown window before adopting newly-published versions.
executes automatically during installation or download, allowing for the execution of arbitrary code.
they are executed with every invocation of Python, therefore exhibiting a persistent behavior on the victim endpoint.