惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
Project Zero
Project Zero
T
The Exploit Database - CXSecurity.com
T
Threat Research - Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyberwarzone
Cyberwarzone
PCI Perspectives
PCI Perspectives
G
GRAHAM CLULEY
H
Hacker News: Front Page
Cloudbric
Cloudbric
Latest news
Latest news
N
News and Events Feed by Topic
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs
SecWiki News
SecWiki News
Security Latest
Security Latest
MyScale Blog
MyScale Blog
阮一峰的网络日志
阮一峰的网络日志
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Security Archives - TechRepublic
Security Archives - TechRepublic
V2EX - 技术
V2EX - 技术
B
Blog RSS Feed
L
LINUX DO - 最新话题
人人都是产品经理
人人都是产品经理
Last Week in AI
Last Week in AI
IT之家
IT之家
Jina AI
Jina AI
Y
Y Combinator Blog
博客园 - 聂微东
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
P
Privacy International News Feed
B
Blog
S
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Hacker News - Newest:
Hacker News - Newest: "LLM"
Help Net Security
Help Net Security
D
DataBreaches.Net
博客园_首页
G
Google Developers Blog
I
InfoQ
量子位
大猫的无限游戏
大猫的无限游戏
S
Security @ Cisco Blogs

Mozilla.ai

Open Models are ready for agents. Their APIs are not. Using Octonous as an AI Safety Engineer The Control Layer: Why the Next Era of AI Is About Infrastructure, Not Just Models Introducing Otari: The Open-Source LLM Control Plane Announcing transcribe.cpp Using Octonous as a Product Manager Image Classification Comes to encoderfile What is an LLM control plane? Use the Otari Gateway with OpenCode Otari: Own Your AI Stack | AI Gateway & Hosted Platform AI Got Expensive. Now What? | Mozilla.ai cq exchange: Agents without Borders The Interface Is No Longer the Product VIBE✓: First Defense for cq (Stack Overflow for Agents) Octonous Open Beta: What We've Learned and Where We're Going Sovereign AI: Control, Choice, and Beyond Geopolitics Encoderfile’s New Format: Why a “Dull” Design Wins The Real Challenge Behind Small Trade Businesses cq: Stack Overflow for Agents cq: Stack Overflow for Agents llamafile Reloaded: What’s New in v0.10.0 When Shipping Software Becomes Too Easy Mozilla.ai Joins Flower Hub as Launch Partner Owning Code in the Age of AI The Star Chamber: Multi-LLM Consensus for Code Quality
Hardening Your LLM Dependency Supply Chain
Anushri Gupta · 2026-03-26 · via Mozilla.ai
Technical Content

When source code and distributed packages don’t match, risks increase. This breakdown of the LiteLLM incident shares what to watch for and how to reduce exposure.

Anushri Gupta

3 min read

Hardening Your LLM Dependency Supply Chain
The Procession of the Trojan Horse into Troy, Giovanni Domenico Tiepolo, c. 1760. Via Wikimedia Commons : Public Domain

On March 24, 2026, LiteLLM, a Python package, with over 95 million monthly downloads, was compromised. Versions 1.82.7 and 1.82.8 on PyPI contained a credential-stealing payload that exfiltrated SSH keys, cloud provider credentials, Kubernetes secrets, API keys, crypto wallets, and database passwords to an attacker-controlled server. 

The attacker who hit LiteLLM just compromised one package and got the keys to everything. They targeted the one dependency that, by definition, sits on every LLM credential in the organization. The source code on GitHub was clean the entire time. If you only audited the repo, you'd have seen nothing.

LLM gateway libraries are uniquely high-value targets. By design, they hold API keys for all the providers you use: OpenAI, Anthropic, Google, Azure, Cohere, and others. 

What happened

A threat actor group known as TeamPCP gained access to the LiteLLM maintainer's PyPI publishing credentials. Using those credentials, they uploaded malicious versions of the package directly to PyPI, completely bypassing the GitHub repository.

The payload used a .pth file: a little-known Python mechanism that auto-executes code on interpreter startup. You don’t need to import litellm for it to run. Just having the package installed is enough for the malware to harvest credentials, establish persistence via systemd, and attempt lateral movement through Kubernetes clusters.

As Andrej Karpathy noted, the compromised version was live for less than an hour and was only discovered because a bug in the malware caused a machine to crash. Without that bug, this could have gone undetected for days or weeks.

The critical detail: this was a divergence between the source repository and the distributed artifact. The GitHub source was clean. The PyPI package was not. Anyone who reviewed the code on GitHub and assumed the published package matched it was wrong.

Five things you can do today

Here are a few things you can do right now. Some of these are band-aids: they address this specific exploit but don't scale across hundreds of dependencies. Trusted publishers (item 3) is the exception: it eliminates the attack vector entirely.

1. Pin exact versions and verify hashes

Stop using loose version specifiers for infrastructure dependencies. Pin to exact versions and use hash verification:

pip install --require-hashes -r requirements.txt

Your requirements.txt should look like:

litellm==1.82.6 --hash=sha256:<known-good-hash>

You can grab the hash for any package version directly from PyPI at https://pypi.org/project/<package>/<version>/#files — click 'view details' next to the wheel file.

2. Audit .pth files in your environments

Most developers don’t realize .pth files can execute code every time the Python interpreter starts. While intended only for adding paths, they are often abused to run arbitrary scripts.

Run this command to find any .pth files in your Python site-packages directory that contain import or exec statements: 

find $(python -c "import site; print(site.getsitepackages()[0])") -name "*.pth" -exec grep -El "import|exec" {} \;

What to look for: Any file that contains more than a simple directory path is a potential security or performance risk.

3. Use PyPI trusted publishers for your own packages

If you maintain a Python package, stop using stored API tokens or passwords to publish to PyPI. Use trusted publishers instead. This is an OIDC-based mechanism that ties your PyPI releases to a specific GitHub Actions workflow. 

4. Compare distributed artifacts against source

Don't assume the package on PyPI matches the code on GitHub. For critical infra dependencies, compare them:

pip download <package>==<version> --no-deps -d /tmp/check

# Unzip the wheel and diff against the tagged source

5. Run a private package mirror with an allowlist

For production deployments, pull packages through a private mirror or proxy (like devpi or Artifactory) that only serves vetted versions so you can block compromised versions before they reach your infrastructure.

How we do it at Mozilla.ai

At any-llm, releases are published to PyPI exclusively through GitHub Actions using PyPI trusted publishers. None of our maintainers holds a PyPI API token. The only path to PyPI is through our CI workflow, which uses OIDC-based authentication, meaning a compromised developer account cannot be used to publish a malicious package.

Migration is easy

If you are currently looking to move off LiteLLM, we’ve made the transition simple. any-llm is a drop-in replacement for OpenAI-compatible proxies.

Check out our 2-step Migration Guide here.

Your LLM gateway is your blast radius. Treat it with the same rigor you’d treat your database or your secrets manager—because, in 2026, that’s exactly what it is.