Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Aug 6, 2024

This PR contains the following updates:

Package Change Age Confidence
PyInstaller (changelog) ==3.4==6.0.0 age confidence

GitHub Vulnerability Alerts

CVE-2019-16784

Impact

Local Privilege Escalation in all Windows software frozen by PyInstaller in "onefile" mode.

The vulnerability is present only on Windows and in this particular case: If a software frozen by PyInstaller in "onefile" mode is launched by a (privileged) user who has his/her "TempPath" resolving to a world writable directory. This is the case e.g. if the software is launched as a service or as a scheduled task using a system account (in which case TempPath will default to C:\Windows\Temp).

In order to be exploitable the software has to be (re)started after the attacker has launched the exploit program. So for a service launched at startup, a service restart is needed (e.g. after a crash or an upgrade).

While PyInstaller itself was not vulnerable, all Windows software frozen by PyInstaller in "onefile" mode is vulnerable.

CVSSv3 score 7.0 (High)
CVSSv3 vector CVSS:3.0/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected

  • all Windows software frozen by PyInstaller in "onefile" mode

No affected

  • PyInstaller itself (except if frozen by PyInstaller in "onefile" mode on Windows)
  • software frozen in "onedir" mode
  • other platforms (GNU/Linux, OS X, BSD, etc.)

Patches

The problem is patched in commits 42a67148b3bdf9211fda8499fdc5b63acdd7e6cc (fixed code) and be948cf0954707671aa499da17b10c86b6fa5e5c (recompiled bootloaders). Users should upgrade to PyInstaller version 3.6 and rebuild their software.

Workarounds

There is no known workaround. Users using PyInstaller to freeze their Windows software using "onefile" mode should upgrade PyInstaller and rebuild their software.

Credits

This vulnerability was discovered and reported by Farid AYOUJIL (@​faridtsl), David HA, Florent LE NIGER and Yann GASCUEL (@​lnv42) from Alter Solutions (@​AlterSolutions) and fixed in collaboration with
Hartmut Goebel (@​htgoebel, maintainer of PyInstaller).

Funding Development

PyInstaller is in urgent need of funding to make future security fixes happen, see https://redirect.github.com/pyinstaller/pyinstaller/issues/4404 for details.

CVE-2023-49797

Impact

A PyInstaller built application, elevated as a privileged process, may be tricked by an unprivileged attacker into deleting files the unprivileged user does not otherwise have access to.

A user is affected if all the following are satisfied:

  • The user runs an application containing either matplotlib or win32com.
  • The application is ran as administrator (or at least a user with higher privileges than the attacker).
  • The user's temporary directory is not locked to that specific user (most likely due to TMP/TEMP environment variables pointing to an unprotected, arbitrary, non default location).
  • Either:
    • The attacker is able to very carefully time the replacement of a temporary file with a symlink. This switch must occur exactly between shutil.rmtree()'s builtin symlink check and the deletion itself
    • The application was built with Python 3.7.x or earlier which has no protection against Directory Junctions links

Patches

The vulnerability has been addressed in https://github.com/pyinstaller/pyinstaller/pull/7827 which corresponds to pyinstaller >= 5.13.1

Workarounds

Is there a way for users to fix or remediate the vulnerability without upgrading?

No workaround, although the attack complexity becomes much higher if the application is built with Python >= 3.8.0.

CVE-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:

  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.


Release Notes

pyinstaller/pyinstaller (PyInstaller)

v6.0.0

Compare Source

Please see the v6.0.0 section of the changelog for a list of the changes since v5.13.2.

v5.13.2

Compare Source

Please see the v5.13.2 section of the changelog for a list of the changes since v5.13.1.

v5.13.1

Compare Source

Please see the v5.13.1 section of the changelog for a list of the changes since v5.13.0. Note that this is a bugfix only release. It's primary purpose is to publish #​7827.

v5.13.0

Compare Source

Please see the v5.13.0 section of the changelog for a list of the changes since v5.12.0.

Note that this is intended to be the last v5.x release. v6.0 will contain breaking changes from #​7619, #​7713 and #​6999. If you want to avoid unexpected disruption, you may wish to pin pyinstaller (e.g. pip install "pyinstaller<6").

v5.12.0

Compare Source

Please see the v5.12.0 section of the changelog for a list of the changes since v5.11.0.

v5.11.0

Compare Source

Please see the v5.11.0 section of the changelog for a list of the changes since v5.10.1.

v5.10.1

Compare Source

Please see the v5.10.1 section of the changelog for a list of the changes since v5.10.0.

v5.10.0

Compare Source

Please see the v5.10.0 section of the changelog for a list of the changes since v5.9.0.

v5.9.0

Compare Source

Please see the v5.9.0 section of the changelog for a list of the changes since v5.8.0.

v5.8.0

Compare Source

Please see the v5.8.0 section of the changelog for a list of the changes since v5.7.0.

v5.7.0

Compare Source

Please see the v5.7.0 section of the changelog for a list of the changes since v5.6.2.

v5.6.2

Compare Source

Please see the v5.6.2 section of the changelog for a list of the changes since v5.6.1.

v5.6.1

Compare Source

Please see the v5.6.1 section of the changelog for a list of the changes since v5.6.

v5.6

Compare Source

Please see the v5.6 section of the changelog for a list of the changes since v5.5.

v5.5

Compare Source

Please see the v5.5 section of the changelog for a list of the changes since v5.4.1.

v5.4.1

Compare Source

Please see the v5.4.1 section of the changelog for a list of the changes since v5.4.

v5.4

Compare Source

Please see the v5.4 section of the changelog for a list of the changes since v5.3.

v5.3

Compare Source

Please see the v5.3 section of the changelog for a list of the changes since v5.2.

v5.2

Compare Source

Please see the v5.2 section of the changelog for a list of the changes since v5.1.

v5.1

Compare Source

Please see the v5.1 section of the changelog for a list of the changes.

v5.0.1

Compare Source

v5.0

Compare Source

Please see the v5.0 section of the changelog for a list of the changes since v4.10.

v4.10

Compare Source

Please see the v4.10 section of the changelog for a list of the changes since v4.9.

v4.9

Compare Source

Please see the v4.9 section of the changelog for a list of the changes since v4.8.

v4.8

Compare Source

Please see the v4.8 section of the changelog for a list of the changes since v4.7.

v4.7

Compare Source

Please see the v4.7 section of the changelog for a list of the changes since v4.6.

v4.6

Compare Source

Please see the v4.6 section of the changelog for a list of the changes since v4.5.1.

v4.5.1: Release 4.5.1

Compare Source

Please see the v4.5.1 section of the changelog for a list of the bufixes since v4.5.

v4.5

Compare Source

Please see the v4.5 section of the changelog for the new features and bufixes since v4.4.

v4.4

Compare Source

See the the v4.4 section of the changelog for the new features and bugfixes since v4.3.

v4.3

Compare Source

Please see the changelog if you wish to see a full list of changes.

v4.2

Compare Source

You can find a detailed list of changes in this release in the change log section of the manual.

v4.1

Compare Source

You can find a detailed list of changes in this release in the change log section of the manual.

v4.0

Compare Source

Release 4.0 adds support for 3rd-party packages to provide PyInstaller hooks along with the package. This allows Maintainers of other Python packages to deliver up-to-date PyInstaller hooks as part of their package. See our sample project for more information.

PyInstaller uses this option itself to provide updated hooks much faster: Many hooks are moved into the new package pyinstaller-hooks-contrib which is updated monthly. This package is installed automatically when installing PyInstaller, but can also be updated independently.

Finally, this version drops support for Python 2.7, which is end-of-life since January 2020.. The minimum required version is now Python 3.5. The last version supporting Python 2.7 was PyInstaller 3.6.

You can find a detailed list of changes in this release in the change log section of the manual.

v3.6

Compare Source

See https://pyinstaller.readthedocs.io/en/v3.6/CHANGES.html for Changelog.

v3.5

Compare Source

See https://pyinstaller.readthedocs.io/en/v3.5/CHANGES.html for Changelog.


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@renovate renovate bot force-pushed the renovate/pypi-pyinstaller-vulnerability branch from 1410705 to 6793281 Compare September 11, 2025 05:00
@renovate renovate bot changed the title Update dependency PyInstaller to v5 [SECURITY] Update dependency PyInstaller to v6 [SECURITY] Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants