pypi package report

Is pyinstaller safe?

3 known vulnerabilities, worst severity HIGH.

// reach

12 direct dependencies

3 carry known advisories, worst HIGH

32 packages depend on it

an advisory here reaches each of them

Create a free accountfor every dependency path, dependent and what to upgrade
// ai model usage

No published models are known to use this package.


cvss
7.0
high

CVSS v4.0 base score out of 10

epss
0.13%
low

chance of exploitation in 30 days, 2nd percentile of all CVEs

xyz score
4.4
medium

CyberXYZ composite out of 10

fig. 01 — GHSA-p2xp-xx3r-mffc, the advisory selected below

// 3 advisories

GHSA-p2xp-xx3r-mffc

HIGHGitHub ratingCVE-2025-59042
// impact

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:

  • Application is built with PyInstaller < 6.0.0; both onedir and onefile mode are affected.
  • Optional bytecode encryption code feature was not enabled during the application build.
  • The attacker can create files/directories in the same directory where the executable is located.
  • The filesystem supports creation of files/directories that contain ? in their name (i.e., non-Windows systems).
  • 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.

// patches

PyInstaller 6.0.0 (f5adf291c8b8) 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 (cfd60b510f95) 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.

// workarounds

If upgrading PyInstaller is no 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.

// cvss v4.0 vector

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

Attack vector
Local
Attack complexity
Low
Attack requirements
None
Privileges required
Low
User interaction
Passive
Confidentiality (vulnerable system)
High
Integrity (vulnerable system)
High
Availability (vulnerable system)
High
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

Checked 2026-11-07 at 00:02 UTC. The most recent advisory here was published 2025-09-10. Updated continuously from NVD, GHSA, OSV and CNA feeds.

Think a verdict here is wrong? Tell us — we respond within 2 business days.