中危 RestrictedPython 容易通过堆栈帧沙箱逃逸执行任意代码 (CVE-2023-37271)
CVE编号
CVE-2023-37271利用情况
暂无补丁情况
官方补丁披露时间
2023-07-12漏洞描述
RestrictedPython is a tool that helps to define a subset of the Python language which allows users to provide a program input into a trusted environment. RestrictedPython does not check access to stack frames and their attributes. Stack frames are accessible within at least generators and generator expressions, which are allowed inside RestrictedPython. Prior to versions 6.1 and 5.3, an attacker with access to a RestrictedPython environment can write code that gets the current stack frame in a generator and then walk the stack all the way beyond the RestrictedPython invocation boundary, thus breaking out of the restricted sandbox and potentially allowing arbitrary code execution in the Python interpreter. All RestrictedPython deployments that allow untrusted users to write Python code in the RestrictedPython environment are at risk. In terms of Zope and Plone, this would mean deployments where the administrator allows untrusted users to create and/or edit objects of type `Script (Python)`, `DTML Method`, `DTML Document` or `Zope Page Template`. This is a non-default configuration and likely to be extremely rare. The problem has been fixed in versions 6.1 and 5.3.解决建议
建议您更新当前系统或软件至最新版,完成漏洞的修复。
参考链接 |
|
---|---|
https://github.com/zopefoundation/RestrictedPython/commit/c8eca66ae49081f0016... | |
https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-w... |
受影响软件情况
# | 类型 | 厂商 | 产品 | 版本 | 影响面 | ||||
1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
运行在以下环境 | |||||||||
应用 | zope | restrictedpython | * | Up to (excluding) 5.3 | |||||
运行在以下环境 | |||||||||
应用 | zope | restrictedpython | 6.0 | - | |||||
运行在以下环境 | |||||||||
系统 | debian_10 | restrictedpython | * | Up to (including) 4.0~b3-2 | |||||
运行在以下环境 | |||||||||
系统 | debian_11 | restrictedpython | * | Up to (including) 4.0~b3-2 | |||||
运行在以下环境 | |||||||||
系统 | debian_12 | restrictedpython | * | Up to (including) 4.0~b3-3 | |||||
运行在以下环境 | |||||||||
系统 | debian_sid | restrictedpython | * | Up to (excluding) 6.2-1 | |||||
- 攻击路径 远程
- 攻击复杂度 容易
- 权限要求 无需权限
- 影响范围 全局影响
- EXP成熟度 未验证
- 补丁情况 官方补丁
- 数据保密性 无影响
- 数据完整性 无影响
- 服务器危害 无影响
- 全网数量 N/A
CWE-ID | 漏洞类型 |
CWE-913 | 动态管理代码资源的控制不恰当 |
Exp相关链接

版权声明
本站原创文章转载请注明文章出处及链接,谢谢合作!
评论