Your AI Gateway Is a Supply Chain Target: Lessons from the LiteLLM 1.107.0 Compromise

On October 21, 2026, attackers compromised the release pipeline for LiteLLM, a popular open-source AI gateway proxy with approximately 23 million weekly downloads, and published malicious packages to PyPI and official Docker images on Docker Hub and GitHub Container Registry. The compromised version, litellm==1.107.0, was live for about two hours before being removed. During that window, the payload ran automatically on every Python process start, without any import statement, and exfiltrated credentials for cloud providers, SSH, browser sessions, AI coding tools, and the LiteLLM proxy's own provider API keys. This is the second LiteLLM supply chain compromise in 2026, following the 1.82.7/1.82.8 incident in March.
For organizations running AI agents, chatbots, or LLM-powered applications, this incident is a reminder that AI gateways are high-value targets. They sit at the center of your AI infrastructure and hold credentials for every model provider you use. Compromising a gateway means compromising access to OpenAI, Anthropic, Azure, AWS Bedrock, and any other provider you route through it. This guide explains what happened, why AI gateways are attractive targets, what to do if you were exposed, and how to prevent similar compromises from affecting your systems.
What happened: the technical details
According to LiteLLM's official incident post, the attack exploited the release pipeline to inject malicious code into the published artifacts. The attacker created a lookalike repository that appeared legitimate and used it to compromise the build process. The malicious version was published to PyPI as litellm==1.107.0 and pushed to the official Docker Hub and GitHub Container Registry images, including the :latest and :main-stable tags.
Microsoft's analysis details the payload mechanism: the malicious wheel contained cook.pth and sitecustomize.py files that Python executes automatically at startup. This means the payload ran without any explicit import of the litellm module. Simply starting a Python process in an environment where litellm==1.107.0 was installed triggered the credential theft.
The payload targeted a broad range of credentials. Datadog's SecurityLabs analysis documents that the malicious code harvested AWS credentials, Azure tokens, GCP service account keys, SSH private keys, browser session cookies and passwords, credentials for AI coding assistants (GitHub Copilot, Cursor, Codeium), and the LiteLLM proxy's configuration, including all provider API keys stored in its config file or environment variables. The payload also installed an hourly remote code loader, establishing persistent access that would survive simple package removal.
StepSecurity's breakdown notes that the attack built from a lookalike repository (Berri-AI/litellm, mimicking the legitimate BerriAI/litellm), which underscores how supply chain attacks exploit the trust relationships in package ecosystems. The attack was not a vulnerability in LiteLLM's code. It was a compromise of the process that produces and publishes that code.
Why AI gateways are high-value targets
LiteLLM and similar AI gateway proxies (like Portkey, Helicone, or self-built routing layers) serve a specific function: they abstract model provider APIs behind a unified interface, handle load balancing, retry logic, cost tracking, and often store credentials for multiple providers in a single configuration. This architectural role makes them particularly attractive targets.
- Credential concentration: A gateway typically holds API keys for every model provider the organization uses. Compromising one system yields access to OpenAI, Anthropic, Azure OpenAI, AWS Bedrock, Google Vertex AI, and any other provider routed through it.
- High privilege: Gateways often run with elevated permissions to access secrets stores, environment variables, and configuration files. The payload does not need to escalate privilege; it inherits the gateway's existing access.
- Infrastructure position: Gateways sit at the center of AI traffic. They see every prompt and response, every model selection decision, and every cost allocation. This makes them valuable for reconnaissance even beyond credential theft.
- Dependency depth: Python packages like LiteLLM have extensive dependency trees. Compromising one popular package can reach thousands of downstream projects. Datadog notes that LiteLLM had approximately 23 million weekly downloads at the time of the incident.
The concentration of credentials in AI gateways is the key risk. In a typical deployment, the gateway configuration file or environment includes API keys for every provider. A compromised gateway does not just expose one service. It exposes the organization's entire model access layer.
What to do if you were exposed
If your systems installed litellm==1.107.0 during the two-hour window on October 21, 2026, or pulled the :latest/:main-stable Docker images during that period, assume compromise. The remediation steps in GitHub issue #47826 provide the authoritative guidance. The following checklist summarizes the essential actions.
1. Do not run pip or Python in the compromised environment
The payload installed a persistent code loader that runs on every Python startup. Running pip install or pip uninstall in the compromised environment will trigger the malicious code again. Instead, capture the environment for forensic analysis, then rebuild from clean artifacts.
2. Rebuild from known-good artifacts
Do not attempt to "clean" the compromised environment. The persistent loader and potential additional payloads make in-place remediation unreliable. Redeploy from a known-good container image or rebuild the environment from your lockfile using a clean base. Verify the package versions and hashes before deploying.
3. Rotate all reachable credentials immediately
Assume any credential accessible to the compromised process was exfiltrated. This includes all AI provider API keys stored in the LiteLLM configuration or environment, cloud provider credentials (AWS, Azure, GCP) accessible to the process, SSH keys on the system, service account tokens, database credentials if the gateway had access, and any secrets in environment variables or mounted config files.
Rotation must be immediate. Do not wait for forensic confirmation that a specific key was used. The payload exfiltrated credentials in bulk; assume all accessible secrets were captured.
4. Revoke and regenerate AI provider keys
For each model provider routed through the gateway, revoke the existing API keys and generate new ones. Update the gateway configuration with the new keys only after rebuilding from clean artifacts. Check provider dashboards for unusual usage during and after the exposure window.
5. Audit cloud logs for unauthorized access
Review CloudTrail, Azure Activity Logs, GCP Audit Logs, and any other cloud logging for the exposure period and the days following. Look for unusual API calls, new IAM entities, resource provisioning, or data access from unfamiliar IP addresses or regions. The attackers may have used the exfiltrated credentials to establish additional persistence or exfiltrate data from cloud services.
6. Check for secondary compromise
The payload harvested SSH keys and browser credentials. If the compromised system had SSH access to other systems, those systems are also at risk. If browser sessions were captured, review for unauthorized access to SaaS applications, email, or other services authenticated through browser cookies.
| Action | Why It Matters |
|---|---|
| Isolate compromised systems | Prevents further credential access and lateral movement |
| Capture environment for forensics | Preserves evidence before rebuilding |
| Rebuild from clean artifacts | In-place cleanup is unreliable due to persistent loader |
| Rotate all provider API keys | Gateway config held credentials for all routed providers |
| Rotate cloud credentials | AWS, Azure, GCP credentials were targeted by payload |
| Rotate SSH keys | Payload harvested SSH private keys on the system |
| Audit cloud logs | Detect unauthorized access using exfiltrated credentials |
| Review browser sessions | Payload captured browser cookies and passwords |
| Check downstream systems | SSH keys may have provided access to other systems |
Prevention: securing your AI infrastructure supply chain
The LiteLLM incident demonstrates that supply chain security is critical for AI infrastructure. The following controls reduce your exposure to similar attacks, whether targeting LiteLLM, other AI packages, or any dependency in your stack.
1. Pin versions and image digests, never use :latest
The compromised Docker images were published under the :latest and :main-stable tags. Organizations that pulled these tags automatically received the malicious version. Instead of using mutable tags, pin to specific version tags and, ideally, to immutable image digests (SHA256 hashes). A digest pin ensures you get exactly the image you vetted, not whatever currently occupies that tag.
For Python packages, pin to exact versions in your requirements file. A constraint like litellm>=1.0.0 will happily install 1.107.0 when it becomes available. A pin like litellm==1.106.3 will not.
2. Use lockfiles with hashes
Beyond version pinning, use lockfiles that record the cryptographic hash of each package artifact. pip's requirements.txt supports hash-checking mode (pip install --require-hashes). Tools like pip-tools, Poetry, and PDM generate lockfiles with hashes by default. If the published artifact changes, hash verification fails, and the install is blocked.
Hash verification would not have prevented installation of the initial malicious package, but it would have prevented silent updates if the attacker published multiple versions or if you attempted to reinstall later.
3. Delay or quarantine new releases
The attack window for litellm==1.107.0 was approximately two hours. Organizations that automatically pull the latest version on every deploy were exposed. Organizations that lag behind releases by a day or more would have missed the malicious version entirely, as it was yanked before they pulled it.
Consider a quarantine period for new releases of critical infrastructure packages. Do not deploy new versions until they have been available for 24-72 hours without incident reports. For production AI gateways, a few days of delay is a reasonable tradeoff for reduced supply chain risk.
4. Isolate gateway secrets with least-privilege access
The payload harvested credentials from environment variables, configuration files, and system-level secrets. Reduce the blast radius by limiting what the gateway process can access. Use a secrets manager (AWS Secrets Manager, HashiCorp Vault, Azure Key Vault) with IAM policies that grant access only to the specific secrets the gateway needs. The gateway should not have broad read access to your secrets store.
Where possible, use short-lived credentials. AWS STS tokens, Azure managed identities, and GCP workload identity federation avoid storing long-lived secrets in the gateway environment. If a token is exfiltrated, it expires before it can be used, or its use is logged and attributed to the compromised workload.
5. Apply least-privilege IAM to the gateway
An AI gateway typically needs to call model provider APIs. It does not need administrative access to your cloud account. Review the IAM roles and policies attached to the gateway's execution environment. Remove broad permissions (s3:*, ec2:*, admin:*). Grant only the specific actions required for the gateway's function.
If the gateway runs in a container orchestration platform (ECS, EKS, Cloud Run), use task-level or pod-level IAM roles rather than node-level roles. This constrains the credentials available to a compromised container.
6. Enforce egress controls
The malicious payload exfiltrated credentials to attacker-controlled infrastructure. Egress controls, firewall rules or network policies that restrict outbound connections to known-good destinations, would have blocked or logged this exfiltration. An AI gateway legitimately needs to reach model provider APIs. It does not need to reach arbitrary IP addresses or domains.
Implement allow-list egress policies where feasible. Log all outbound connections. Alert on connections to unexpected destinations. Even if you cannot block egress entirely, logging provides detection capability after the fact.
7. Run SBOM and dependency monitoring
A Software Bill of Materials (SBOM) inventories every package and version in your deployment. Dependency monitoring tools (Dependabot, Snyk, Renovate, Socket) can alert you when a package is flagged as compromised, yanked, or associated with a security incident. If your monitoring had flagged litellm==1.107.0 within the two-hour window, you could have avoided deploying it.
SBOM and monitoring also help during incident response. When a package is compromised, you can quickly identify which systems have that package installed and prioritize remediation.
8. Separate build-time and runtime credentials
Build environments often have broad access: pulling from package registries, pushing to container registries, deploying to infrastructure. Runtime environments should have narrower access. Do not share credentials between build and runtime. A compromised build dependency should not grant access to production secrets, and a compromised runtime dependency should not grant access to your CI/CD pipeline.
Use separate service accounts for CI/CD and for production workloads. Rotate CI/CD credentials separately from production credentials. This limits the blast radius if either is compromised.
| Control | Implementation | What It Prevents |
|---|---|---|
| Pin versions and digests | litellm==1.106.3 and SHA256 image digests | Automatic adoption of malicious updates |
| Lockfiles with hashes | pip --require-hashes, Poetry, PDM | Silent artifact replacement |
| Release quarantine | 24-72 hour delay on new versions | Exposure during short attack windows |
| Secrets isolation | Secrets manager with scoped IAM policies | Bulk credential exfiltration |
| Short-lived credentials | STS, managed identities, workload federation | Usability of stolen credentials |
| Least-privilege IAM | Task/pod-level roles, no wildcard permissions | Blast radius of compromised gateway |
| Egress controls | Allow-list outbound, log all connections | Credential exfiltration to attacker infrastructure |
| SBOM and monitoring | Dependabot, Snyk, Socket | Deploying known-compromised packages |
| Separate build/runtime credentials | Different service accounts | Cross-contamination between CI/CD and production |
The pattern: second compromise in 2026
This is the second supply chain compromise of LiteLLM in 2026. The March incident (versions 1.82.7 and 1.82.8) used a similar attack pattern. When the same project is compromised twice in one year, it suggests that the release pipeline remains a viable target. Organizations depending on LiteLLM, or any high-value package with similar pipeline characteristics, should treat supply chain security as an ongoing concern, not a one-time fix.
The broader lesson is that popular open-source infrastructure packages are targets. The more widely used a package, the more valuable it is to attackers. AI gateways, model serving frameworks, and other AI infrastructure components inherit this risk profile. The controls described above apply not just to LiteLLM but to any critical dependency in your AI stack.
Connection to credential security and agent governance
The secrets and agent identity checklist we published earlier this month describes how AI agents can find and exploit exposed credentials. The LiteLLM incident is the other side of the same problem: instead of an agent finding your exposed secrets, an attacker plants a package that actively harvests them. The defensive posture is the same: assume secrets will be targeted, reduce what is accessible, use short-lived credentials, and log everything.
The AI security fundamentals we recommend, including scoping credentials, logging actions, and controlling egress, apply equally to AI gateways and to the agents that use them. Gateway security and agent security are not separate disciplines. They are layers in the same defense.
How Vyntrix Labs builds secure AI automation
When we deploy AI agents and automation for clients, we treat the supply chain as a threat surface. We pin all dependencies to specific versions with hash verification. We do not pull :latest tags in production. We use secrets managers with least-privilege IAM policies, and we prefer short-lived credentials over static API keys. Egress controls and logging are part of the baseline architecture, not add-ons.
For organizations evaluating their AI infrastructure security, we offer AI automation audits that assess supply chain risk alongside credential exposure, agent governance, and logging. The audit identifies which packages are pinned, which are not, where secrets are stored, and what egress controls exist. We then build the controls to close the gaps. See AI agents for custom development and AI automation for workflow automation with supply chain security built in.
Summary
The LiteLLM 1.107.0 compromise is a reminder that AI gateways are high-value targets. They concentrate credentials for multiple model providers in a single system. A successful supply chain attack on a gateway package yields access to your entire AI infrastructure layer.
If you were exposed, isolate compromised systems, rebuild from clean artifacts, rotate all accessible credentials, and audit cloud logs for unauthorized access. Do not attempt in-place cleanup; the persistent loader makes it unreliable.
For prevention, pin versions and image digests, use lockfiles with hashes, quarantine new releases, isolate secrets with least-privilege access, enforce egress controls, and monitor your dependency tree. These controls reduce your exposure to the next supply chain attack, whether it targets LiteLLM or any other package in your stack.
Frequently asked questions
Was litellm==1.107.0 malicious?
Yes. On October 21, 2026, attackers compromised the LiteLLM release pipeline and published litellm==1.107.0 to PyPI, along with corresponding Docker images to Docker Hub and GHCR. The malicious version was live for approximately two hours before being removed. The payload executed automatically on Python startup and exfiltrated credentials for cloud providers, SSH, browsers, AI coding tools, and the proxy's own provider API keys.
How did the malicious code run without importing litellm?
The malicious wheel included cook.pth and sitecustomize.py files. Python automatically executes .pth files and sitecustomize.py at startup, before any application code runs. This means any Python process in an environment where litellm==1.107.0 was installed triggered the payload, regardless of whether the application imported the litellm module.
Why are AI gateways particularly high-value targets?
AI gateways typically store API keys for multiple model providers (OpenAI, Anthropic, Azure, etc.) in a single configuration. Compromising the gateway yields credentials for the organization's entire model access layer. Gateways also run with elevated permissions to access secrets stores and see all AI traffic, making them valuable for both credential theft and reconnaissance.
Should I stop using LiteLLM?
The decision depends on your risk tolerance and the controls you can implement. LiteLLM remains a widely used and actively maintained project. However, this is the second supply chain compromise in 2026, which indicates the release pipeline is a viable target. If you continue using LiteLLM, implement the prevention controls described in this post: pin versions with hashes, delay new releases, isolate secrets, and enforce egress controls.
What is the difference between version pinning and hash verification?
Version pinning specifies which version to install (litellm==1.106.3). Hash verification additionally confirms that the downloaded artifact matches a known-good cryptographic hash. Version pinning alone does not protect against a compromised version being published under a trusted version number or against artifact tampering. Hash verification ensures you get exactly the artifact you vetted.
How long should I quarantine new releases?
A 24-72 hour delay is a reasonable starting point for critical infrastructure packages. The LiteLLM 1.107.0 attack window was approximately two hours. A one-day delay would have avoided exposure entirely. Longer delays provide more margin but increase the time to receive legitimate security patches. Balance the tradeoff based on the criticality of the package and your organization's risk tolerance.
Haseeb Tariq
Co-Founder at Vyntrix Labs
Keep reading

AI Agents Are Finding Your Leaked Credentials: A Secrets Checklist
CERT-In's October 2026 advisory confirms it: AI agents in testing and production environments reached live systems through exposed credentials. A practical checklist for hunting secrets, governing agent identity, and assuming compromise.
Haseeb Tariq
Co-Founder
AI Security and Compliance: A Practical Guide for Business Systems
What AI security actually covers (data leakage, prompt injection, access control, RAG permissions, audit logs, and governance) and a checklist for deciding how strong those controls need to be.
Haseeb Tariq
Co-Founder

AI Agent Governance: Guardrails for Agents That Act on Your Business
How to govern AI agents that take real actions: permission boundaries, approval gates, action whitelists, audit trails, and the minimum controls to deploy agents in production without losing visibility.
Haseeb Tariq
Co-Founder