Home / pyinstaller / pyinstaller / CVE-2025-59042
CVE-2025-59042: is it exploited, and which versions of pyinstaller are affected and fixed?
CVE-2025-59042 is a code injection (remote code execution) vulnerability in pyinstaller. It is not known to be exploited: it is not in CISA's Known Exploited Vulnerabilities catalog (catalog 2026.11.30, read December 3, 2026, 13:08 UTC). Affected: pyinstaller before 6.0.0 (GitHub advisory GHSA-p2xp-xx3r-mffc). Fixed in 6.0.0 (GitHub advisory GHSA-p2xp-xx3r-mffc). Severity: High (7.0, CVSS 4.0, from GitHub_M).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 13:08 UTC, CVE record November 19, 2026, 07:09 UTC and NVD November 19, 2026, 07:17 UTC.
What is 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.
From the CVE record by GitHub_M, last updated September 10, 2025, 17:24 UTC.
Which versions are affected, and which fix it?
| Vendor | Product | Affected | Fixed or not affected from |
|---|---|---|---|
| pyinstaller | pyinstaller | < 6.0.0 |
As the CVE record by GitHub_M states it, last updated September 10, 2025. Version ranges are the CNA's; a version the record calls not affected is usually the fix.
Which packages are affected, and in which version is each fixed?
| Ecosystem | Package | Affected | Fixed in | Advisory |
|---|---|---|---|---|
| PyPI | pyinstaller | < 6.0.0 | 6.0.0 | GHSA-p2xp-xx3r-mffc |
GitHub Advisory Database, reviewed advisories (CC BY 4.0); advisory updated September 10, 2025. Summary: PyInstaller has local privilege escalation vulnerability.
How severe is CVE-2025-59042?
| Score | Version | Vector | Source |
|---|---|---|---|
| High 7.0 | CVSS 4.0 | 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 | GitHub_M |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2025-59042 exploited in the wild?
- CISA KEV
- Not listed (catalog 2026.11.30)
- CISA SSVC
- Exploitation: none; automatable: no; technical impact: total (CISA ADP, September 10, 2025)
- EPSS
- 0.14% probability of exploitation activity in the next 30 days, percentile 3.2 (FIRST EPSS, scores of December 2, 2026)
What kind of flaw is it?
- CWE-94 Improper Control of Generation of Code
Where are the vendor advisories and references?
- https://github.com/pyinstaller/pyinstaller/security/advisories/GHSA-p2xp-xx3r-mffc x_refsource_CONFIRM
- https://github.com/pyinstaller/pyinstaller/commit/f5adf291c8b832d5aff7632844f7e3ddf7ad4923 x_refsource_MISC
When was it published, and where is the official record?
- Reserved
- September 8, 2025
- Published
- September 9, 2025, 22:28 UTC
- CVE record updated
- September 10, 2025, 17:24 UTC by GitHub_M
- NVD
- Deferred, last modified October 23, 2026, 22:10 UTC
- Last checked
- CVE list November 19, 2026, 07:09 UTC; NVD November 19, 2026, 07:17 UTC; KEV December 3, 2026, 13:08 UTC; EPSS December 2, 2026
- Official record
- cve.org · NVD
What other CVEs affect pyinstaller?
- Dec 9, 2023CVE-2023-49797 pyinstaller: creation of Temporary File in Directory with Insecure Permissions
- Jan 14, 2020CVE-2019-16784 PyInstaller: runs with more privileges than needed
Questions about CVE-2025-59042
Is CVE-2025-59042 exploited in the wild?
Not as far as CISA knows: it is not in the Known Exploited Vulnerabilities catalog, read December 3, 2026, 13:08 UTC. FIRST's EPSS gives it a 0.14% chance of exploitation activity in the next 30 days (scores of December 2, 2026).
Which versions of pyinstaller are affected by CVE-2025-59042?
pyinstaller before 6.0.0, per the GitHub advisory GHSA-p2xp-xx3r-mffc. The tables above give every range the sources list.
Which version fixes CVE-2025-59042?
6.0.0, per the GitHub advisory GHSA-p2xp-xx3r-mffc. Check the vendor's advisory before you rely on it.
How severe is CVE-2025-59042?
High (7.0, CVSS 4.0, from GitHub_M). The severity table above shows each score with its source.
Where is the official record of CVE-2025-59042?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov. For a fix, the vendor's own advisory is the one to follow.