LiteLLM 1.107.0 遭供应链投毒:攻击者借三名开发者 GitHub 凭证改发布流程,窃取云与模型密钥
10 月 21 日,攻击者利用三名 LiteLLM 开发者的 GitHub 凭证篡改发布流程,向 PyPI 和 Docker latest 标签推送带毒的 litellm 1.107.0;恶意包会在每次 Python 启动时运行,窃取云、SSH、CI/CD 与 AI 工具凭证及 LiteLLM 数据库中的密钥。
开源大模型网关 LiteLLM 10 月 21 日遭遇供应链攻击。根据安全从业者 @modularciso 在 X 上整理的信息(援引 LiteLLM 官方事件通报),攻击者使用三名 LiteLLM 开发者的 GitHub 凭证篡改了发布工作流,于 UTC 时间 11:39 把带毒的 litellm 1.107.0 推送到 PyPI,并推送到带 latest 标签的 Docker 镜像。PyPI 在 UTC 13:23 前下架了该版本,Docker Hub 上的相关标签在 UTC 14:20 前恢复干净。
LiteLLM 常被企业用作统一调用各家模型服务的 AI 网关,因此网关所在环境往往保存着全部上游模型提供商的密钥。帖文指出,这次的恶意版本正是冲着这些密钥来的。据安全公司 Aikido 研究员 Ilyas Makari 的分析,恶意包会植入 cook.pth 等文件,使恶意代码在每一次 Python 启动时运行,甚至包括执行 pip;它会窃取云平台、SSH、CI/CD 和各类 AI 工具的凭证,以及存放在 LiteLLM 数据库中的密钥,并运行一个每小时轮询一次、拉取远程代码执行的远控程序。
flowchart LR
A[窃得 3 名开发者<br/>GitHub 凭证] --> B[篡改发布工作流]
B --> C[发布 1.107.0 到 PyPI<br/>UTC 11:39]
B --> D[推送 Docker latest 标签]
C --> E[安装后每次 Python 启动即执行]
D --> E
E --> F[窃取云/SSH/CI/CD/AI 工具凭证<br/>及网关数据库中的密钥]
E --> G[远控程序每小时轮询拉取代码]
帖文给出的排查建议包括三点:第一,检查是否在上述时间窗口内安装过 1.107.0,或拉取过 latest 镜像;第二,检查主机上是否存在 /tmp/.pc_once_* 或 /tmp/remote_code_loader.lock 文件;第三,如果中招,应基于 1.106.2 重建环境,并轮换该主机能够触达的所有密钥。帖文同时说明,目前下载量和攻击者身份仍不清楚。
这起事件再次暴露了 AI 应用研发中的一个薄弱环节:模型网关、智能体框架等基础组件更新频繁,很多流水线习惯直接拉取 latest 标签或不锁定版本号,一旦上游发布链路被攻破,影响会迅速扩散到生产环境。对研发团队而言,锁定依赖版本、对镜像使用摘要固定、把模型密钥放入专门的密钥管理服务并缩小网关主机权限,是更现实的防护手段。
LiteLLM 1.107.0 supply chain compromise
LiteLLM 1.107.0 supply chain compromise
Your AI gateway holds every model provider key you own, and a poisoned LiteLLM release was built to take them.
On Oct 21, attackers used GitHub credentials of three LiteLLM developers to alter the release workflow and push litellm 1.107.0 to PyPI at 11:39 UTC and to Docker images tagged latest. PyPI pulled it by 13:23 UTC and Docker Hub tags were clean by 14:20 UTC (LiteLLM incident post).
The package drops cook.pth and https://t.co/h8AoTStIha, which run on every Python start, even pip. Aikido (Ilyas Makari) says it steals cloud, SSH, CI/CD and AI tool credentials plus keys stored in the LiteLLM database, and runs a RAT that polls hourly for code.
Check now:
- Installs of 1.107.0 or latest pulls in that window
- /tmp/.pc_once_* or /tmp/remote_code_loader.lock on hosts
- If hit: rebuild on 1.106.2 and rotate every secret the host could reach
Unknown: downloads and attacker. Did your pipelines pull latest today? #supplychainautomation https://t.co/1Jymkwdhlb