IPBUF安全漏洞报告
English
CVE-2026-34955 CVSS 8.8 高危

CVE-2026-34955 PraisonAI沙箱逃逸漏洞

披露日期: 2026-04-04

漏洞信息

漏洞编号
CVE-2026-34955
漏洞类型
沙箱逃逸
CVSS评分
8.8 高危
攻击向量
本地 (AV:L)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
PraisonAI

相关标签

沙箱逃逸PraisonAIRCECVE-2026-34955命令注入

漏洞概述

PraisonAI 在 4.5.97 版本之前存在严重安全漏洞。其 SubprocessSandbox 组件在所有模式下调用 subprocess.run() 时使用了 shell=True,并仅依赖字符串黑名单来拦截危险命令。由于黑名单未包含 sh 或 bash 等独立可执行文件,攻击者可轻易绕过限制,导致沙箱逃逸,进而执行任意命令,造成系统完全沦陷。

技术细节

该漏洞的根本原因在于 PraisonAI 的 SubprocessSandbox 错误地实现了安全过滤机制。在处理用户输入时,系统直接调用了 Python 的 subprocess.run() 函数并启用了 shell=True 参数。虽然代码中通过字符串匹配的方式设置了命令黑名单,试图阻止危险操作,但该机制存在逻辑缺陷。黑名单未将常见的 Unix Shell 解释器(如 sh 或 bash)列为禁止项。因此,在 STRICT 模式下,攻击者只需构造形如 `sh -c '<malicious_command>'` 的 payload,即可绕过黑名单检测。由于 shell=True 的存在,subprocess 会启动 sh 来解析命令,进而执行攻击者指定的任意系统指令,导致沙箱隔离失效,引发本地权限提升或代码执行风险。

攻击链分析

STEP 1
1. 侦察与访问
攻击者确定目标运行了 PraisonAI < 4.5.97 版本,并具有访问 SubprocessSandbox 功能的权限(低权限用户)。
STEP 2
2. 载荷构造
攻击者构造恶意载荷,利用黑名单未包含 'sh' 或 'bash' 的缺陷,格式为 'sh -c <command>'。
STEP 3
3. 绕过防御
载荷被提交给 SubprocessSandbox。由于 'sh' 不在黑名单中,字符串匹配检查通过。
STEP 4
4. 命令执行
subprocess.run() 以 shell=True 模式启动,调用系统 sh 执行载荷中的任意命令,实现沙箱逃逸。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import subprocess # Simulation of the vulnerable SubprocessSandbox logic def vulnerable_sandbox(command): # The blocklist in the actual product misses 'sh' and 'bash' blocklist = ['rm', 'cat', 'whoami'] for blocked in blocklist: if blocked in command: print(f"Blocked command detected: {blocked}") return print(f"Executing: {command}") # The vulnerability: using shell=True allows shell interpreters subprocess.run(command, shell=True) # PoC: Bypassing the sandbox using 'sh -c' # 'whoami' is in the blocklist, but 'sh -c' is not. payload = "sh -c 'whoami'" vulnerable_sandbox(payload)

影响范围

PraisonAI < 4.5.97

防御指南

临时缓解措施
如果无法立即升级,建议暂时禁用受影响的 SubprocessSandbox 功能,或在操作系统层面通过 AppArmor/SELinux 限制进程权限,防止通过 sh 调用获取更高权限。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表