CVE-2025-59042 (CNNVD-202509-1126)

HIGH
中文标题:
PyInstaller 代码注入漏洞
英文标题:
PyInstaller has local privilege escalation vulnerability
CVSS分数: 7.0
发布时间: 2025-09-09 22:28:20
漏洞类型: 代码注入
状态: PUBLISHED
数据质量分数: 0.30
数据版本: v3
漏洞描述
中文描述:

PyInstaller是Python基金会的一个Python库,它会分析您的代码以发现您的脚本需要执行的所有其他模块和库。 PyInstaller 6.0.0之前版本存在代码注入漏洞,该漏洞源于sys.path处理不当,可能导致任意代码执行。

英文描述:

PyInstaller bundles a Python application and all its dependencies into a single package. Due to a special entry being appended to `sys.path` during the bootstrap process of a PyInstaller-frozen application, and due to the bootstrap script attempting to load an optional module for bytecode decryption while this entry is still present in `sys.path`, an application built with PyInstaller < 6.0.0 may be tricked by an unprivileged attacker into executing arbitrary python code when **all** of the following conditions are met. First, the application is built with PyInstaller < 6.0.0; both onedir and onefile mode are affected. Second, the optional bytecode encryption code feature was not enabled during the application build. Third, the attacker can create files/directories in the same directory where the executable is located. Fourth, the filesystem supports creation of files/directories that contain `?` in their name (i.e., non-Windows systems). Fifth, the attacker is able to determine the offset at which the PYZ archive is embedded in the executable. The attacker can create a directory (or a zip archive) next to the executable, with the name that matches the format used by PyInstaller's bootloader to transmit information about the location of PYZ archive to the bootstrap script. If this directory (or zip archive) contains a python module whose name matches the name used by the optional bytecode encryption feature, this module will be loaded and executed by the bootstrap script (in the absence of the real, built-in module that is available when the bytecode-encryption feature is enabled). This results in arbitrary code execution that requires no modification of the executable itself. If the executable is running with elevated privileges (for example, due to having the `setuid` bit set), the code in the injected module is also executed with the said elevated privileges, resulting in a local privilege escalation. PyInstaller 6.0.0 (f5adf291c8b832d5aff7632844f7e3ddf7ad4923) removed support for bytecode encryption; this effectively removes the described attack vector, due to the bootstrap script not attempting to load the optional module for bytecode-decryption anymore. PyInstaller 6.10.0 (cfd60b510f95f92cb81fc42735c399bb781a4739) reworked the bootstrap process to avoid (ab)using `sys.path` for transmitting location of the PYZ archive, which further eliminates the possibility of described injection procedure. If upgrading PyInstaller is not feasible, this issue can be worked around by ensuring proper permissions on directories containing security-sensitive executables (i.e., executables with `setuid` bit set) should mitigate the issue.

CWE类型:
CWE-94
标签:
(暂无数据)
受影响产品
厂商 产品 版本 版本范围 平台 CPE
pyinstaller pyinstaller < 6.0.0 - - cpe:2.3:a:pyinstaller:pyinstaller:<_6.0.0:*:*:*:*:*:*:*
解决方案
中文解决方案:
(暂无数据)
英文解决方案:
(暂无数据)
临时解决方案:
(暂无数据)
参考链接
https://github.com/pyinstaller/pyinstaller/security/advisories/GHSA-p2xp-xx3r-mffc x_refsource_CONFIRM
cve.org
访问
https://github.com/pyinstaller/pyinstaller/commit/f5adf291c8b832d5aff7632844f7e3ddf7ad4923 x_refsource_MISC
cve.org
访问
CVSS评分详情
4.0 (cna)
HIGH
7.0
CVSS向量: CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
机密性
HIGH
完整性
HIGH
可用性
HIGH
后续系统影响 (Subsequent):
机密性
NONE
完整性
NONE
可用性
NONE
时间信息
发布时间:
2025-09-09 22:28:20
修改时间:
2025-09-10 17:24:35
创建时间:
2025-11-11 15:40:46
更新时间:
2025-11-11 16:00:09
利用信息
暂无可利用代码信息
数据源详情
数据源 记录ID 版本 提取时间
CVE cve_CVE-2025-59042 2025-11-11 15:23:31 2025-11-11 07:40:46
NVD nvd_CVE-2025-59042 2025-11-11 15:01:02 2025-11-11 07:48:33
CNNVD cnnvd_CNNVD-202509-1126 2025-11-11 15:12:56 2025-11-11 08:00:09
版本与语言
当前版本: v3
主要语言: EN
支持语言:
EN ZH
安全公告
暂无安全公告信息
变更历史
v3 CNNVD
2025-11-11 16:00:09
vulnerability_type: 未提取 → 代码注入; cnnvd_id: 未提取 → CNNVD-202509-1126; data_sources: ['cve', 'nvd'] → ['cnnvd', 'cve', 'nvd']
查看详细变更
  • vulnerability_type: 未提取 -> 代码注入
  • cnnvd_id: 未提取 -> CNNVD-202509-1126
  • data_sources: ['cve', 'nvd'] -> ['cnnvd', 'cve', 'nvd']
v2 NVD
2025-11-11 15:48:33
data_sources: ['cve'] → ['cve', 'nvd']
查看详细变更
  • data_sources: ['cve'] -> ['cve', 'nvd']