CVE-2025-59042 | PyInstaller has local privilege escalation vulnerability

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.

公開: 2025-09-09 最終更新: 2026-06-17 Assigner: [email protected] ソース: [email protected]

総合評価: CVE-2025-59042 は低リスク(28.7/100)。CVSS 深刻度は高。悪用される可能性が高い(EPSS 0.11%、2 パーセンタイル) 推奨対応: 悪用情報と EPSS の推移を監視し、必要に応じて優先度を見直してください。

リスクは変動します。再評価に基づき、本ページの表示内容を更新しています。

CVE-2025-59042 の EPSS(Exploit Prediction Scoring System)スコア

EPSS は日次で悪用されやすさの相対度合いを推定します。パーセンタイルは採点済み CVE の中での相対位置(高いほど相対的に深刻)を示します。

# 日付 旧 EPSS スコア 新 EPSS スコア Δ(新 − 旧)
1 2026-06-15 0.01% 0.11% +0.10%
2 2025-09-10 0.01%

EPSS の全履歴 (全 2 件)

CVE-2025-59042 の CVSS(Common Vulnerability Scoring System)指標

この CVE の CVSS 指標。

ベーススコア バージョン 深刻度 ベクトル 悪用しやすさ 影響 スコアの出典
7.0 4.0 HIGH
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X クリックして展開
攻撃ベクター (AV:L)
対象ホスト上でコードを走らせる、またはローカル権限が前提。
攻撃の複雑さ (AC:L)
手順が短く、再現性が高い。
攻撃要件 (AT:N)
到達性以外に、追加のインフラ条件やデータ前提は要らない。
必要な権限 (PR:L)
一般ユーザー権限で足り、管理者は不要。
ユーザーの関与 (UI:P)
リンクのクリック、インストール承認など、一度の人の判断が要る。
脆弱システムの機密性への影響 (VC:H)
広範な機微情報の窃取や長期滞留が現実的。
脆弱システムの完全性への影響 (VI:H)
監査ログの改竄や広範なデータ偽装など、信頼根拠を崩す水準。
脆弱システムの可用性への影響 (VA:H)
長時間のサービス不能やデータ損壊に伴う復旧困難が現実的。
後続システムの機密性への影響 (SC:N)
脆弱点を経由して下流の機微情報が読まれうる余地はほとんどない。
後続システムの完全性への影響 (SI:N)
下流の記録や設定が歪められる局面はほとんど想定されない。
後続システムの可用性への影響 (SA:N)
下流サービスが止まるほどの影響は想定しにくい。
悪用の成熟度(Threat) (E:X)
Threat 情報が未指定のとき、最悪側(実害報告あり)に寄せて採点する。
機密性に対するセキュリティ要件(環境) (CR:X)
未指定のときは情報不足とみなし、スコア上は高要求(保守的)として扱う。
完全性に対するセキュリティ要件(環境) (IR:X)
未指定のときは情報不足とみなし、スコア上は高要求(保守的)として扱う。
可用性に対するセキュリティ要件(環境) (AR:X)
未指定のときは情報不足とみなし、スコア上は高要求(保守的)として扱う。
変更後の攻撃ベクター (MAV:X)
環境側で上書きしない限り、ベースの AV を採用。
変更後の攻撃の複雑さ (MAC:X)
環境側で上書きしない限り、ベースの AC を採用。
変更後の攻撃要件 (MAT:X)
環境側で上書きしない限り、ベースの AT を採用。
変更後の必要な権限 (MPR:X)
環境側で上書きしない限り、ベースの PR を採用。
変更後のユーザーの関与 (MUI:X)
環境側で上書きしない限り、ベースの UI を採用。
変更後の脆弱システムの機密性への影響 (MVC:X)
環境側で上書きしない限り、ベースの VC を採用。
変更後の脆弱システムの完全性への影響 (MVI:X)
環境側で上書きしない限り、ベースの VI を採用。
変更後の脆弱システムの可用性への影響 (MVA:X)
環境側で上書きしない限り、ベースの VA を採用。
変更後の後続システムの機密性への影響 (MSC:X)
環境側で上書きしない限り、ベースの SC を採用。
変更後の後続システムの完全性への影響 (MSI:X)
環境側で上書きしない限り、ベースの SI を採用。
変更後の後続システムの可用性への影響 (MSA:X)
環境側で上書きしない限り、ベースの SA を採用。
安全性(補足、スコア非変更) (S:X)
人的安全への追加評価を行わない。
自動化可否(補足、スコア非変更) (AU:X)
キルチェーン自動化の評価を行わない。
復旧(補足、スコア非変更) (R:X)
サービス復元パスの評価を行わない。
価値密度(補足、スコア非変更) (V:X)
一撃で握れる資産規模の評価を行わない。
対応工数(補足、スコア非変更) (RE:X)
修復コストの評価を行わない。
提供元の緊急度(補足、スコア非変更) (U:X)
ベンダー色分けの緊急度を付さない。
[email protected]

CVE-2025-59042 の弱点分類(列挙)

CVE-2025-59042 の GitHub Security Advisory

GHSA-p2xp-xx3r-mffc · 深刻度: high · エコシステム: pip — PyInstaller has local privilege escalation vulnerability

CVE-2025-59042 の影響を受けるソフトウェア/構成

ベンダー 製品 バージョン 生の CPE
データセットに影響を受ける製品はありません。

CVE-2025-59042 の参考情報

cvelogic Threat Intelligence