字号·· | 护眼
漏洞档案 · 高危

LiteLLM 防护栏沙箱逃逸远程代码执行(CVE-2026-40217):已收录 KEV 的在野利用漏洞,需优先处置

CVE-2026-40217 别名:GHSA-3926-2JVF-FG29、GHSA-WXXX-GVQV-XP7P、PYSEC-2026-2601
CVSS 8.8 / 3.1 EPSS 20.6% CISA KEV 在野利用 公开 PoC · 2 Nuclei 模板
综合风险73/ 100
CVSS8.8高危
EPSS20.6%30 天利用概率
机构收录时间2026-04-10更新 2026-11-27

研判简报

LiteLLM 防护栏沙箱逃逸远程代码执行(CVE-2026-40217):已收录 KEV 的在野利用漏洞,需优先处置

概述

LiteLLM 的 /guardrails/test_custom_code 接口允许已认证用户提交任意 Python 代码用于防护栏测试,其仅依赖正则表达式对源码做危险操作过滤。攻击者可通过字符串拼接绕过正则,并借助 CPython 字节码重写(code.replace(co_names=...)、替换 __code__)提取真实 __import__,最终以 LiteLLM 进程权限执行任意命令(默认 Docker 镜像中为 root)。该漏洞同时影响 Red Hat Ansible Automation Platform、OpenShift AI 等集成发行版本,暴露于公网的 LiteLLM 代理实例应重点关注。

严重性

CVSS 8.8(3.1 版),综合风险分 85.76/100,评级 high;攻击面为面向公众的 HTTP API,需已认证身份(参考材料给出的 CVSS 4.0 评分为 8.7,与官方记录存在出入,以官方记录为准)。CWE-420、CWE-94,对应 MITRE ATT&CK T1059 与 T1190。

利用状态

截至核查日期 2026-11-24:CISA KEV 已于 2026-11-18 收录,SSVC 判定 exploitation=active;EPSS 30 天利用概率 82.8%(百分位 99.7%);已有公开 Nuclei 检测模板(http/cves/2026/CVE-2026-40217.yaml)及 Exploit-DB/公开 PoC 2 条。勒索软件关联情况材料未给出。

受影响产品

  • litellm:>=1.81.8 <1.83.10
  • ansible_automation_platform:>=2.0 <2.6-9
  • openshift_ai:>=3.3 <3.3.4
  • openshift_lightspeed:材料未给出具体版本区间 参考材料另确认 ghcr.io/berriai/litellm:main-latest 镜像受影响,并注明补丁版本 TBD(与官方修复记录存在出入,以官方记录为准)。部署形态涉及容器镜像与上述平台集成场景。

修复版本

官方记录给出受影响区间上界(litellm 1.83.10、ansible_automation_platform 2.6-9、openshift_ai 3.3.4),并引用 RHSA-2026:24866、RHSA-2026:30056 公告;各产品具体修复版本号材料未逐一给出。

缓解措施

按 CISA KEV 要求于期限 2026-12-02 前依厂商说明应用缓解措施,并遵循 BOD 26-04 与 Forensics Triage Requirements;无法缓解的云服务应停用该产品。评估各资产互联网暴露面;在修复前限制 /guardrails/test_custom_code 接口的访问与认证权限,降低 LiteLLM 进程运行权限(避免以 root 运行容器)。

响应步骤

  1. 盘点资产:核对 litellm、ansible_automation_platform、openshift_ai、openshift_lightspeed 的版本是否落在受影响区间,标记公网暴露实例。
  2. 检测:使用公开 Nuclei 模板对 /guardrails/test_custom_code 路径进行排查,并结合日志审计该 URI 的异常调用与字节码相关特征。
  3. 处置:按厂商公告升级至修复版本;无法立即升级的实例先下线该接口或收紧认证与网络访问。
  4. 权限收敛:将 LiteLLM 容器以非 root 用户运行,缩小潜在 RCE 影响。
  5. 取证与上报:按 CISA Forensics Triage Requirements 保留证据,确认是否发生命令执行痕迹。
  6. 期限管理:在 2026-12-02 前完成 KEV 要求的缓解动作并记录合规状态。

参考来源

  1. https://www.x41-dsec.de/lab/advisories/x41-2026-001-litellm/Exploit,Mitigation,Third Party Advisory,advisory,euvd
  2. https://access.redhat.com/errata/RHSA-2026:24866Third Party Advisory
  3. https://access.redhat.com/errata/RHSA-2026:30056Third Party Advisory
  4. https://access.redhat.com/security/cve/CVE-2026-40217Third Party Advisory
  5. https://bugzilla.redhat.com/show_bug.cgi?id=2457301Third Party Advisory
  6. https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40217.jsonThird Party Advisory
  7. https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-40217US Government Resource
  8. https://github.com/BerriAI/litellm/security/advisories/GHSA-wxxx-gvqv-xp7pkev
  9. https://www.cisa.gov/news-events/directives/bod-26-04-prioritizing-security-updates-based-riskkev
  10. https://www.cisa.gov/news-events/directives/bod-26-04-implementation-guidance-priorikev
  11. https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2026/CVE-2026-40217.yamlexploit,nuclei
  12. https://api.vulncheck.com/v3/index/vulncheck-canaries?cve=CVE-2026-40217kev
  13. https://cloud.google.com/blog/topics/threat-intelligence/agentic-threat-activity-crosses-a-significant-thresholdkev
  14. https://euvd.enisa.europa.eu/enisa/EUVD-2026-21376kev
  15. https://www.cisa.gov/known-exploited-vulnerabilities-catalogkev
  16. https://vulncheck.com/xdb/ca56f7434d6bexploit,vulncheck_xdb