Python Software Foundation and CERT-In warn of targeted supply-chain exploits in Python AI packages
· Python PSF
Coordinated security alerts warn that attackers are tampering with Python AI packages to execute startup code that steals cloud keys and developer credentials.
Key numbers
- CIAD-2026-0053 CERT-In Python Advisory
- .pth Hijacking Automatic startup execution
- AI Token Theft Harvesting Copilot & API keys
What was announced
The Python Software Foundation and India's CERT-In published coordinated alerts regarding supply-chain attacks aimed at software developers and AI researchers. The warnings, including CERT-In advisory CIAD-2026-0053, detail how bad actors infected developer tools and artificial intelligence proxy utilities distributed across the Python Package Index.
Engineers should check their Python environments for unfamiliar startup files and immediately replace exposed credentials.
How the attack works
Intruders manipulated build setups for packages such as LiteLLM SDK to insert covert startup routines:
- Interpreter startup takeover: Threat actors add rogue
.pthfiles alongside customsitecustomize.pyscripts to packages. These run automatically whenever Python starts up inside virtual environments, CI/CD runners, or containers. - Credential collection: The software deploys an in-memory script named
privcollect. It harvests developer tokens for AI tools including Anthropic, Cursor, GitHub Copilot, and OpenAI. - System secret extraction: The script also searches for cloud keys across AWS, Azure, and GCP, alongside SSH keys, GPG credentials, and web cookies.
- Certificate verification rules: Meanwhile, runtime updates tied to CVE-2026-115557 enforce strict TLS certificate blocks across
pipand thesslmodule to counter compromised certificate authorities.
Recommended actions
Security teams recommend three immediate countermeasures:
- Inspect all
site-packagesdirectories across local setups and container images for unexpected.pthorsitecustomize.pyfiles. - Restrict all project packages with cryptographic hash checks using
pip-tools,poetry, oruv. - Rotate every cloud token, API key, and deployment secret that passed through impacted machines.
Source: https://www.python.org/news/security/
Tags: CERT-In, Cybersecurity, LiteLLM, PSF, PyPI, Python, Supply chain