深翼判例库DeepWing Case Library · INC-052 · 工具层Tool

LiteLLM 供应链投毒:PyPI 上 1.82.7 与 1.82.8 被植入凭据窃取载荷,上游 CI 流水线所用的 Trivy 扫描工具先被攻破。 一句话(英):LiteLLM supply chain poisoning: versions 1.82.7 and 1.82.8 on PyPI carried a credential stealer, after the Trivy scanner used in its CI pipeline was compromised first.LiteLLM supply chain poisoning: versions 1.82.7 and 1.82.8 on PyPI carried a credential stealer, after the Trivy scanner used in its CI pipeline was compromised first.

主失效层Primary failure layer:工具层Tool | 证据状态Evidence:一手已核Primary-source verified | 披露日期Disclosed:2026-03-24 | 核查日期Checked:2026-10-30

时间线Timeline

2026-03-24 10:39 UTC带毒版本 1.82.7 发布到 PyPI,10:52 续发 1.82.8
2026-03-24 16:00 UTC官方受影响窗口结束
2026-03-24BerriAI 官方披露与状态帖开立,PyPA 立 PYSEC-2026-2
2026-03-24 10:39 UTCPoisoned version 1.82.7 is published to PyPI, followed by 1.82.8 at 10:52
2026-03-24 16:00 UTCThe official affected window ends
2026-03-24BerriAI's official disclosure and status thread open; PyPA records PYSEC-2026-2

已证实事实Confirmed facts

2026-03-24,攻击者把带毒的 LiteLLM 1.82.7 与 1.82.8 两个版本直接发布到 PyPI,绕过了 GitHub 的正常发布流程,GitHub 上不存在这两个版本的标签,官方源码未被污染(BerriAI 官方披露)。据 BerriAI 官方安全更新页:通过 pip 安装的受影响窗口为 2026-03-24 10:39 UTC 至 16:00 UTC,两个版本的发布时间分别为 10:39 与 10:52 UTC(发布时间为 Snyk 分析口径,与官方窗口起点一致),装到这两个版本的环境都在影响范围内。载荷是凭据窃取程序:扫描环境变量、SSH 密钥、AWS 与 GCP 与 Azure 凭据、Kubernetes 令牌、数据库口令等,加密后发往 models.litellm.cloud,该域名不是 BerriAI 官方域名。两个版本的注入方式不同:1.82.7 把载荷以 Base64 形式嵌进 proxy_server.py,导入代理模块时触发;1.82.8 另加了一个 litellm_init.pth 文件,在该环境每次启动 Python 解释器时都会执行(StepSecurity 静态分析)。上游链条:据 Endor Labs、StepSecurity 等厂商分析,攻击方 TeamPCP 先攻破了 LiteLLM 的 CI 流水线所用的 Trivy 安全扫描工具(aquasecurity/trivy-action),由此拿到 PyPI 发布凭据并接管维护者账号发布带毒版本;BerriAI 官方披露确认投毒来自 Trivy 依赖。带毒版本随后被删除,维护者账号与密钥全部轮换,BerriAI 称已请 Mandiant 协助处置(官方状态帖置顶更新)。不受影响的路径:官方 LiteLLM Proxy Docker 镜像(依赖锁定)、从 GitHub 源码安装、1.82.6 及更早版本(官方安全更新页)。PyPA 顾问库就此立 PYSEC-2026-2。暴露窗口时长各源另有约 40 分钟至约 5 小时数说,本条只用官方受影响窗口,其余说法不写入。

On March 24, 2026, an attacker published poisoned LiteLLM versions 1.82.7 and 1.82.8 directly to PyPI, bypassing GitHub's normal release flow; no tags for these versions exist on GitHub and the official source was not contaminated (BerriAI's official disclosure). Per BerriAI's official security update page, the affected window for pip installs ran from 10:39 to 16:00 UTC on March 24 (the two versions were published at 10:39 and 10:52 UTC, per Snyk's analysis, matching the window's start), and any environment that installed either version was in scope. The payload was a credential stealer: it scanned environment variables, SSH keys, AWS, GCP and Azure credentials, Kubernetes tokens, database passwords and more, encrypted them and sent them to models.litellm.cloud, a domain that is not BerriAI's. The two versions injected differently: 1.82.7 embedded the payload in Base64 inside proxy_server.py, triggered on importing the proxy module; 1.82.8 added a litellm_init.pth file that executed on every Python interpreter start in that environment (StepSecurity static analysis). The upstream chain, per vendor analyses by Endor Labs and StepSecurity: the attacker group TeamPCP first compromised the Trivy security scanner (aquasecurity/trivy-action) used in LiteLLM's CI pipeline, obtained the PyPI publishing credentials and took over the maintainer account to publish the poisoned versions; BerriAI's official disclosure confirms the poisoning came through the Trivy dependency. The poisoned versions were later deleted, maintainer accounts and keys were fully rotated, and BerriAI says Mandiant was engaged (pinned update on the official status thread). Unaffected paths: the official LiteLLM Proxy Docker image (pinned dependencies), installs from GitHub source, and version 1.82.6 and earlier (official security update page). The PyPA advisory database recorded the case as PYSEC-2026-2. Other sources put the exposure window anywhere between about 40 minutes and about 5 hours; this entry uses only the official affected window.

失效机制Failure mechanism深翼分析DeepWing analysis

工具层失效:LiteLLM 是集中保管各家模型 API 密钥的网关型工具,自身发布管线被投毒,等于把窃取程序送进所有自动升级的环境;.pth 机制又使载荷脱离「是否调用该库」,常驻每次 Python 启动。平台关在于发布凭据只系于 CI 中的一个第三方扫描工具,上游一破,全链失守。归因口径:TeamPCP 的认定来自安全厂商分析,记为归因口径,不是司法或官方定论。

A tool layer failure: LiteLLM is a gateway style tool that centrally holds model API keys for many providers, so poisoning its own release pipeline delivered the stealer into every auto upgrading environment, and the .pth mechanism detached the payload from whether the library was ever called, making it resident at every Python start. On the platform gate, the publishing credential hung on a single third party scanner inside CI; once the upstream broke, the whole chain fell. Attribution note: the TeamPCP attribution comes from security vendor analysis and is recorded as an attribution position, not a judicial or official finding.

工程启示Engineering lessons

发布凭据不单点:发布凭据不能只系于 CI 中的一个第三方工具,上游一破全链失守。

上游工具先验:CI 里的安全扫描工具本身也要钉版本并核验来源。

自动升级要有刹车:自动升级环境对新版本设观察期与回滚路径。

No single point for release credentials:publishing credentials cannot hang on one third party tool inside CI; once the upstream breaks, the whole chain falls.

Verify upstream tools first:the security scanner inside CI itself needs pinned versions and provenance checks.

Auto-upgrades need a brake:auto-upgrading environments need an observation window and a rollback path for new versions.

你的系统里,Agent 的对外动作有人盯着吗?Is anyone watching what your agents do outside your system?

做 17 题免费自检Take the free 17-question self-check

回到判例库Back to the Case Library →