CVE-2025-59042
BaseFortify
Publication date: 2025-09-09
Last updated on: 2025-09-11
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| pyinstaller | pyinstaller | <6.0.0 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-94 | The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability affects PyInstaller versions before 6.0.0. PyInstaller bundles Python applications into a single package, but during the bootstrap process, it appends a special entry to sys.path and tries to load an optional module for bytecode decryption. If the bytecode encryption feature was not enabled, an attacker who can create files or directories next to the executable (on non-Windows systems that allow '?' in filenames) and can determine the offset of the embedded PYZ archive can create a specially named directory or zip archive containing a malicious Python module. This module will be loaded and executed by the bootstrap script, leading to arbitrary code execution without modifying the executable. If the executable runs with elevated privileges, this can lead to local privilege escalation.
How can this vulnerability impact me? :
This vulnerability can allow an unprivileged attacker to execute arbitrary Python code within the context of the PyInstaller application. If the application runs with elevated privileges (e.g., setuid bit set), the attacker can escalate their privileges locally, potentially gaining higher access on the system. This can lead to unauthorized actions, data compromise, or system control.
What immediate steps should I take to mitigate this vulnerability?
To mitigate this vulnerability, immediately ensure that executables built with PyInstaller versions prior to 6.0.0 do not have writable directories next to them by unprivileged users, especially if the executables have elevated privileges (e.g., setuid bit set). Restrict permissions on directories containing these executables to prevent attackers from creating files or directories that could be used to inject malicious Python modules. Additionally, upgrade PyInstaller to version 6.0.0 or later, as these versions have removed the vulnerable bytecode encryption feature and reworked the bootstrap process to eliminate this attack vector.