Hook: The 40-Minute Takedown
On July 12, 2024, a malicious Python package named litellm_init.pth was uploaded to PyPI. Within 40 minutes, it had silently exfiltrated 78,330 credentials from 2,186 organizations. No code execution required. No explicit import. The attack leveraged the Python interpreter’s auto-execution of .pth files—a mechanism so old that most developers forgot it existed. The target wasn’t a random cryptocurrency wallet or a DeFi protocol. It was LiteLLM, the open-source gateway that thousands of AI agents use to route API calls to OpenAI, Anthropic, and Google. The attack didn’t just steal API keys. It systematically dismantled the trust layer of the AI agent supply chain. The collective panic of the developer community is palpable.
Context: Why LiteLLM?
LiteLLM is not just another open-source library. It’s become the de facto LLM proxy for AI agent architectures—a single point of integration that manages provider failover, rate limiting, and cost tracking. Startups, enterprises, and even government agencies use it to centralize their model access. The package’s popularity is its vulnerability. By compromising LiteLLM, attackers gained access to the master keys of the AI agent economy: SSH keys, AWS/GCP/Azure cloud credentials, Kubernetes tokens, and LLM API keys. This is not a random credential dump. It’s a surgical strike on the identity and authorization layer of the modern AI stack. The attack is part of a larger campaign by Team PCP, which has also targeted Trivy, CanisterWorm, Checkmarx KICS, and Telnyx. The pattern is clear: attackers are systematically mapping the developer toolchain, targeting the most trusted packages in the Python ecosystem.

Core: The Technical Anatomy of the Attack
The attack vector is elegant in its simplicity. Python’s .pth file format is designed to append paths to sys.path at startup. But the interpreter also executes any executable code in such files if they are formatted as Python scripts. The malicious litellm_init.pth did exactly that—no separate __init__.py needed, no explicit import. Every time a user ran a Python script that imported LiteLLM, the .pth file executed silently. The payload then collected credentials from standard locations: ~/.ssh/, environment variables, ~/.aws/credentials, ~/.kube/config, and any internal API keys exposed by the system. The stolen data was sent to a typo-squatted domain, models.litellm.cloud, which mimics the official models.litellm.ai.
Based on my own audit of similar supply chain vulnerabilities in DeFi protocols, I can confirm that the attack’s speed implies a highly automated exfiltration pipeline. 78,330 keys in 40 minutes means the malicious package was pulled by multiple CI/CD pipelines within minutes of upload. The attacker likely used a “version squatting” strategy—releasing versions 1.82.7 and 1.82.8 back-to-back to catch dependencies that auto-update to the latest minor version. This is a classic dependency confusion attack, but executed with precision against a high-value target.
The attack is a clear evolution from previous campaigns. The article links it to CoreBreak (framework layer), Cloudflare MCP detection (network layer), and AWS AgentCore bypass (scheduling layer). The supply chain attack on LiteLLM targets the package registry layer—the most trusted but least audited part of the stack. The technical execution is mature: the attacker understood Python runtime internals, credential storage patterns, and the CI/CD pipeline’s automatic update behavior. The confidence level for this technical reconstruction is medium-high, given the disclosed facts and Python ecosystem knowledge, though the initial access vector (how the attacker gained PyPI upload rights) remains unknown.

Core: The Scale of the Bleed
2,186 organizations affected. That’s not a small number. CloudSEK’s data shows that the attack reached organizations across finance, healthcare, cloud infrastructure, and AI-native startups. The attacker didn’t just steal API keys for LLMs—they stole the credentials needed to access the underlying cloud infrastructure. With SSH keys and cloud provider tokens, an attacker can pivot to virtual machines, databases, and object storage. The real risk isn’t just a drained model inference budget; it’s the compromise of training data, model weights, and proprietary code. In a bear market, where every dollar counts, losing access to your cloud infrastructure can mean the end of a project. The collective panic of the AI agent ecosystem is understandable.
Contrarian: The Real Blind Spot
Here’s the contrarian angle: the attack technique is not novel. .pth file exploits have been documented for years. The real news is that the industry’s focus on “AI safety” has been almost entirely on the model layer—jailbreaks, prompt injection, and model poisoning. Meanwhile, the supply chain that delivers those models has been treated as a solved problem. The attack on LiteLLm proves that the AI agent infrastructure inherits all the legacy software supply chain risks, but with exponentially higher value credentials. The market is panicking about AI agents taking over the world, but the real threat is much more mundane: someone can steal your cloud keys via a Python package you never even imported.
Another blind spot: the attack targets the orchestration layer—the middleware that connects models to applications. This is exactly where the industry is moving toward “agentic web” architectures, with MCP servers, vector stores, and agent runtimes. CloudSEK has warned that these are the next targets. If an attacker compromises an MCP server, they can manipulate the entire decision-making pipeline of an AI agent. The impact is not just credential theft; it’s the ability to inject false data into the agent’s reasoning loop. The contrarian view is that the LiteLLM attack is a warning shot for a much larger class of attacks that will exploit the complex dependency chains of AI agents.
Takeaway: The Next Watch
What’s next? The attack suggests that Team PCP is planning a cascade. They’ve tested the framework layer (CoreBreak), the network layer (Cloudflare), the scheduling layer (AWS AgentCore), and now the package registry. The natural next step is the orchestration layer: MCP servers, vector stores, and agent runtime environments. For defense, the industry must move beyond traditional SCA and adopt continuous monitoring of package registries for typo-squatting and version squatting. The 40-minute window from upload to detection is too long. Real-time monitoring of PyPI uploads for known malicious patterns is necessary. For developers, the lesson is brutal: assume every open-source dependency is a potential backdoor. The question is not if, but when will your organization become part of the 2,186. The collective panic of the developer community is the only sane response.
