CVE-2026-33718 描述了 Openhands 中的一个命令注入漏洞,该漏洞允许经过身份验证的攻击者执行任意命令。该漏洞存在于 getgitdiff() 方法中。受影响的版本为 ≤1.4.1。该问题已在 1.5.0 版本中得到修复,建议用户尽快升级。
OpenHands 中的 CVE-2026-33718 由于命令注入存在重大风险。openhands/runtime/utils/githandler.py:134 中的 getgitdiff() 方法未正确验证通过 /api/conversations/{conversationid}/git/diff API 接收到的 path 参数。这使得经过身份验证的攻击者能够在代理沙箱中执行任意命令,绕过正常的命令执行通道。问题的严重性在于它可能破坏系统安全,允许使用代理权限执行恶意代码。
经过身份验证的攻击者可以通过向 /api/conversations/{conversation_id}/git/diff API 发送恶意请求,其中包含专门设计的 path 参数,从而利用此漏洞,该参数旨在注入系统命令。这些命令将在代理的沙箱中执行,从而可能允许攻击者访问敏感信息、修改文件或控制系统。
Development teams utilizing OpenHands for AI-driven development are at risk. Specifically, organizations with legacy OpenHands deployments (versions ≤1.4.1) and those who have not implemented robust access controls around the /api/conversations/{conversation_id}/git/diff endpoint are particularly vulnerable. Shared hosting environments where multiple users share the same OpenHands instance also face increased risk.
• linux / server:
journalctl -u openhands | grep -i "command injection"• generic web:
curl -I 'http://your-openhands-instance/api/conversations/{conversation_id}/git/diff?path=; whoami' | grep 'HTTP/1.1 500' # Check for error indicating command executiondisclosure
漏洞利用状态
EPSS
0.30% (54% 百分位)
CISA SSVC
减轻 CVE-2026-33718 的解决方案是将 OpenHands 升级到 1.5.0 或更高版本。此版本包含一个修复程序,该修复程序在将 path 参数传递给系统命令之前对其进行验证和清理。同时,作为临时措施,请限制对 /api/conversations/{conversation_id}/git/diff API 的访问,并监控 API 活动以查找任何可疑行为。尽快应用升级对于防止此漏洞被利用至关重要。
将 OpenHands 更新到 1.5.0 或更高版本。此版本修复了 Git diff 处理中的命令注入漏洞。更新将阻止在代理沙盒中执行任意命令。
漏洞分析和关键警报直接发送到您的邮箱。
代理沙箱是一个隔离的环境,OpenHands 代理在该环境中运行。它旨在限制代理对系统资源的访问,并保护其免受恶意代码的侵害。
命令注入是一种安全漏洞,允许攻击者通过将恶意命令注入到用户输入中,在系统上执行任意命令。
检查您正在使用的 OpenHands 版本。如果版本低于 1.5.0,则您容易受到此漏洞的影响。
如果您怀疑您的系统已被破坏,您应该将其与网络隔离,更改密码,并进行全面的安全审计。
作为临时措施,您可以限制对 API 的访问并监控其活动。但是,升级到 1.5.0 或更高版本是推荐的解决方案。
CVSS 向量
上传你的 requirements.txt 文件,立即知道是否受影响。