Alta

PyInstaller has local privilege escalation vulnerability

  • Publicada: 10.09.2025
  • Actualizado: 11.10.2026 13:19

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:

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

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.

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) pyinstaller < 6.0.0 6.0.0

Referencias

Puntuación CVSS -
Vector 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
Debilidad (CWE)
CWE-94
Plataforma
Python (PyPI)
Paquete
pyinstaller
Publicada
10.09.2025
Actualizado
11.10.2026 13:19

Fuentes y licencias

OSV / GitHub Advisory Database - PYSEC-2026-1813 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-p2xp-xx3r-mffc - CC BY 4.0

Historial de vulnerabilidades: pyinstaller

Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
3
Primera → última
01.2020 09.2025
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Alta 3

Divulgaciones por año

  1. 2020: 1
  2. 2021: 0
  3. 2022: 0
  4. 2023: 1
  5. 2024: 0
  6. 2025: 1
  7. 2026: 0
  1. PyInstaller has local privilege escalation vulnerability esta entrada
    Alta CVE-2025-59042 < 6.0.0 6.0.0
  2. Alta · 8.8 CVE-2023-49797 < 5.13.1 5.13.1
  3. Alta · 7.0 CVE-2019-16784 < 3.6 3.6

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.