字号·· | 护眼
漏洞档案 · 严重

pytorch torchserve 服务端请求伪造(CVE-2023-43654)

CVE-2023-43654 别名:GHSA-8FXR-QFR9-P34W、PYSEC-2026-553
CVSS 10.0 / 3.1 EPSS 50.6% CISA KEV 在野利用 公开 PoC · 2 Nuclei 模板
综合风险87/ 100
CVSS10.0严重
EPSS50.6%30 天利用概率
机构收录时间2023-09-29更新 2026-11-28

研判简报

概述

TorchServe 是用于生产环境部署与扩缩 PyTorch 模型的工具。其默认配置缺少恰当的输入校验,第三方可借此发起远程 HTTP 下载请求并向磁盘写入文件,从而破坏系统完整性与敏感数据。该问题存在于 0.1.0 至 0.8.1 版本,用户可从任意 URL 加载自选模型,而 allowed_urls 的配置责任落在用户侧。使用 TorchServe 对外提供推理服务、且沿用默认配置的团队应重点关注。

严重性

CVSS 10.0(3.1 版),综合风险分 85.5/100;EPSS 30 天利用概率 42.5%(百分位 98.7%,日期 2026-11-25)。攻击面为面向公众的推理服务接口,CWE-918(SSRF),CISA SSVC 判定 automatable=yes、technical_impact=total。

利用状态

核查日期 2026-11-25。CISA KEV 已收录(收录日期 2025-11-26);已有公开 Nuclei 检测模板(http/cves/2023/CVE-2023-43654.yaml);Exploit-DB/公开 PoC 记录 1 条;参考链接中另有 Metasploit 模块与 ShellTorchChecker 工具条目。勒索软件关联情况材料未给出。KEV 要求动作:按厂商说明修复或缓解,否则停用产品;期限材料未给出。

受影响产品

pytorch:serve >= 0.1.0, < 0.8.2;pytorch:torchserve >= 0.1.0, < 0.8.2。组件为 TorchServe 模型服务与模型加载/下载路径;部署形态涉及对外暴露的 HTTP 推理端点,官方公告另列出受影响的 DLC 镜像标签系列(EC2、SageMaker、Graviton、Neuron 等)。

修复版本

官方修复版本为 torchserve 0.8.2,包含针对 allowed_urls 默认值告警的变更(PR #2534)。官方公告同时给出随 0.8.2 发布的 DLC 镜像标签清单(如 v1.9-pt-ec2-2.0.1-inf-gpu-py310、v1.8-pt-sagemaker-2.0.1-inf-cpu-py310 等),完整镜像 URI 见公告引用行。官方说明称无已知变通办法。

缓解措施

按官方说明,用户需自行配置 allowed_urls 并明确指定所用模型 URL,避免沿用默认值;在无法立即升级时,限制 TorchServe 管理/推理接口的对外暴露,仅允许可信来源访问,并监控异常的远程下载与磁盘写入行为。官方称无已知 workaround,故升级至 0.8.2 为首选。

响应步骤

  1. 盘点所有 TorchServe 实例与镜像标签,确认版本是否落在 >= 0.1.0, < 0.8.2 区间。
  2. 升级至 torchserve 0.8.2 或改用公告列出的已修补 DLC 镜像标签。
  3. 检查并显式配置 allowed_urls,禁止默认值;核对模型 URL 来源白名单。
  4. 收敛暴露面:对公网可达的推理/管理端点加访问控制与网络隔离。
  5. 用 Nuclei 模板 http/cves/2023/CVE-2023-43654.yaml 做资产自查,并排查异常下载与文件写入痕迹。
  6. 按 KEV 要求记录修复或停用决策;期限与厂商进一步表态材料未给出。

参考来源

  1. https://dashboard.shadowserver.org/statistics/honeypot/vulnerability/map/?host_type=src&vulnerability=cve-2023-43654kev
  2. https://vulncheck.com/xdb/0755a2cc6ea9exploit,vulncheck_xdb
  3. https://github.com/OligoCyberSecurity/ShellTorchCheckerpoc,github,exploit,poc_github
  4. https://vulncheck.com/kev/cve-2023-43654advisory,vulncheck_kev
  5. https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2023/CVE-2023-43654.yamlexploit,nuclei
  6. https://github.com/rapid7/metasploit-framework/tree/master/modules/exploit_multi/http/torchserver_cve_2023_43654exploit,metasploit
  7. https://github.com/pytorch/serve/security/advisories/GHSA-8fxr-qfr9-p34wx_refsource_CONFIRM,x_refsource_CONFIRM,x_transferred,advisory,euvd
  8. https://github.com/pytorch/serve/pull/2534x_refsource_MISC,x_refsource_MISC,x_transferred,advisory,euvd
  9. https://github.com/pytorch/serve/releases/tag/v0.8.2x_refsource_MISC,x_refsource_MISC,x_transferred,advisory,euvd
  10. http://packetstormsecurity.com/files/175095/PyTorch-Model-Server-Registration-Deserialization-Remote-Code-Execution.htmlx_transferred,advisory,euvd
  11. https://euvd.enisa.europa.eu/vulnerability/EUVD-2023-2697advisory,euvd
  12. https://github.com/OligoCyberSecurity/CVE-2023-43654exploit,poc_github