# PyPI 上的 LiteLLM 1.107.0 被植入后门

Original title: Compromised LiteLLM 1.107.0 on PyPI Installs a Credential Stealer and Backdoor

> Hacker News story 50181114 · language: zh · submitted 2026-10-21
> Web version: https://zeli.app/zh/story/50181114
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 587 · by [abhisek](<https://news.ycombinator.com/user?id=abhisek>) · 💬 191
[original](<https://safedep.io/litellm-pypi-compromise-credential-stealer-backdoor/>) · [HN discussion](<https://news.ycombinator.com/item?id=50181114>)

## Summary

PyPI 上的 LiteLLM 1.107.0 版本已被证实被篡改， installer 会在 site-packages 中植入凭证窃取器和远程代码执行后门。攻击者利用 maturin 构建配置，将恶意文件 cook.pth 和 sitecustomize.py 混入所有平台的 wheel 包中。一旦安装，这些恶意代码会在任何 Python 进程启动时自动运行，无需导入 LiteLLM 库。窃取目标包括 SSH 密钥、浏览器密码、云凭证以及 AI 开发工具（如 Cursor、Claude Code）的 Token。此外，后门还会每小时从 GitHub 拉取新指令并执行远程代码。SafeDep 分析指出，上游 GitHub 源码干净，问题出在发布流程被攻破或 PyPI 凭证泄露。

## Key quote

> 这两个文件会在主机上的任何 Python 进程启动时运行，即使该进程从未导入过 LiteLLM。

## HN discussion (191 comments)

### [linsomniac](<https://news.ycombinator.com/item?id=50184883>)

> 只是提醒大家一下，https://canarytokens.org/ 这个网站是存在的。

### [rsanheim](<https://news.ycombinator.com/item?id=50187074>)

> 这已经是 LiteLLM 在短短一两年内遭遇的第二次重大漏洞利用了？就在昨晚，我还翻到了一份旧版 Claude 会话的笔记和脚本，用来审计所有项目依赖并确认没有用到 litellm。
>
> 好吧，查了一下，那是今年三月的事：https://futuresearch.ai/blog/litellm-pypi-supply-chain-attac.... 在 LLM 时代，时间到底是什么概念啊？

### [crossroadsguy](<https://news.ycombinator.com/item?id=50184801>)

> 所有的 sandbox-exec 和所有 Lulu 规则都防不住这种事。
>
> 当权限弹窗疲劳症发作时，我们开始像对待平常事一样授予任何权限。我们对安装工具也变得麻木了：brew、npm，这都成了第二天性。
>
> “哦，包 X 安装了 367 个工具？行吧行吧，肯定正常，现在大家都这样”。
>
> “Brew 显示有 59 个包过时了？”“必须升级”。“行，搞定。完美”。
>
> 再加上智能体（agents）和各种框架的涌现。这已经不是会不会发生的问题，而是何时发生！操作系统得采取点行动。至少得帮用户轻松拥有完全隔离的“程序空间”，提供更好的、更简单的、更轻量的虚拟机。我知道，我知道——Unix 和 Linux 早在亚历山大三世穿尿布之前就把这些都解决了。当然，肯定是这样。

### [pkulak](<https://news.ycombinator.com/item?id=50184311>)

> 一个三年内有 5.5 万次提交的项目，怎么可能发生这种事？

### [threecheese](<https://news.ycombinator.com/item?id=50186105>)

> “攻击者攻陷了 3 个独特的开发者 GitHub 凭证”这话有点吓人；这看起来是系统性问题——如果三个开发者的密钥都被盗了，说明真正的问题出在别处。
>
> 他们撤销了除一人外的所有开发者权限，这大概是正确的做法，但我建议把 LiteLLM 锁定在“此版本之前”的某个版本，并一直保持在原地，直到另行通知！

### [madamelic](<https://news.ycombinator.com/item?id=50183673>)

> 我没搞懂有人是怎么把文件偷偷塞进发布包里的。
>
> 我读到的所有内容只是说它从构建文件中创建了一个目录，但似乎没有描述新文件或新增的依赖是如何溜过去的。`cook.pth` 是一个在安装时从 PyPI 自动下载的依赖，然后构建系统把它放进了依赖列表里吗？
>
> \--
>
> 留个笔记给其他人：
>
> \> BerriAI 的私有发布流水线从被攻击者修改过的 git 源码构建这些 wheel 包。攻击者可能利用了被攻陷的维护者或机器人凭证、私有分支或镜像，或者是流水线构建所引用的源。从攻击者自己的机器上使用被盗的 PyPI 令牌这一说法与证据吻合度较低。
>
> 讲得通。是维护者或私有流水线遭到了攻击，恶意依赖是通过潜伏在维护者的本地副本中被注入的，而不是依赖被针对所有人劫持。非常狡猾。

### [yujonglee](<https://news.ycombinator.com/item?id=50185595>)

> 官方事件通告：https://docs.litellm.ai/blog/security-incident-oct-21-2026

### [stbenjam](<https://news.ycombinator.com/item?id=50182491>)

> 在我看来，uv、npm 等工具的默认设置都应该有 24 到 48 小时的冷却期，你应该得特意去操作才能安装更新版本。

---

## Cite

- Page: https://zeli.app/zh/story/50181114
- Date: 2026-10-21
- Source: safedep.io (https://safedep.io/litellm-pypi-compromise-credential-stealer-backdoor/)
- Hacker News: https://news.ycombinator.com/item?id=50181114

## Other languages

- en: https://zeli.app/story/50181114 · markdown: https://zeli.app/story/50181114.md
- ja: https://zeli.app/ja/story/50181114 · markdown: https://zeli.app/ja/story/50181114.md
- ko: https://zeli.app/ko/story/50181114 · markdown: https://zeli.app/ko/story/50181114.md
- de: https://zeli.app/de/story/50181114 · markdown: https://zeli.app/de/story/50181114.md
- es: https://zeli.app/es/story/50181114 · markdown: https://zeli.app/es/story/50181114.md
- ru: https://zeli.app/ru/story/50181114 · markdown: https://zeli.app/ru/story/50181114.md
