Skip to content

CVE-2023-49797 Local Privilege Escalation in pyinstaller on Windows

HighCVSS 7.8 EPSS 0.32%
Published
Updated
Exploit status
No public exploit known

Description

PyInstaller bundles a Python application and all its dependencies into a single package. 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: 1. The user runs an application containing either matplotlib or win32com. 2. The application is ran as administrator (or at least a user with higher privileges than the attacker). 3. 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: A. 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 B: The application was built with Python 3.7.x or earlier which has no protection against Directory Junctions links. The vulnerability has been addressed in PR #7827 which corresponds to pyinstaller >= 5.13.1. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Upgrade path

2 packages: 2 fixed.

PackageAffectedFixed inStatus
pyinstaller < 5.13.1; = < 5.13.1 5.13.1 Fixed
pypi pyinstaller(PyPI) < 5.13.1; = 1.5; = 1.5.1; = 2.0 +42 more 5.13.1 Fixed

Affected products

ProductAffected versionsFixed in
pypi pyinstaller(PyPI) < 5.13.1 5.13.1
pypi pyinstaller(PyPI) = 1.5 No fix listed
pypi pyinstaller(PyPI) = 1.5.1 No fix listed
pypi pyinstaller(PyPI) = 2.0 No fix listed
pypi pyinstaller(PyPI) = 2.1 No fix listed
pypi pyinstaller(PyPI) = 3.0 No fix listed
pypi pyinstaller(PyPI) = 3.1 No fix listed
pypi pyinstaller(PyPI) = 3.1.1 No fix listed
pypi pyinstaller(PyPI) = 3.2 No fix listed
pypi pyinstaller(PyPI) = 3.2.1 No fix listed
pypi pyinstaller(PyPI) = 3.3 No fix listed
pypi pyinstaller(PyPI) = 3.3.1 No fix listed
pypi pyinstaller(PyPI) = 3.4 No fix listed
pypi pyinstaller(PyPI) = 3.5 No fix listed
pypi pyinstaller(PyPI) = 3.6 No fix listed
pypi pyinstaller(PyPI) = 4.0 No fix listed
pypi pyinstaller(PyPI) = 4.1 No fix listed
pypi pyinstaller(PyPI) = 4.10 No fix listed
pypi pyinstaller(PyPI) = 4.2 No fix listed
pypi pyinstaller(PyPI) = 4.3 No fix listed
pypi pyinstaller(PyPI) = 4.4 No fix listed
pypi pyinstaller(PyPI) = 4.5 No fix listed
pypi pyinstaller(PyPI) = 4.5.1 No fix listed
pypi pyinstaller(PyPI) = 4.6 No fix listed
pypi pyinstaller(PyPI) = 4.7 No fix listed
Show 23 more
ProductAffected versionsFixed in
pypi pyinstaller(PyPI) = 4.8 No fix listed
pypi pyinstaller(PyPI) = 4.9 No fix listed
pypi pyinstaller(PyPI) = 5.0 No fix listed
pypi pyinstaller(PyPI) = 5.0.1 No fix listed
pypi pyinstaller(PyPI) = 5.1 No fix listed
pypi pyinstaller(PyPI) = 5.10.0 No fix listed
pypi pyinstaller(PyPI) = 5.10.1 No fix listed
pypi pyinstaller(PyPI) = 5.11.0 No fix listed
pypi pyinstaller(PyPI) = 5.12.0 No fix listed
pypi pyinstaller(PyPI) = 5.13.0 No fix listed
pypi pyinstaller(PyPI) = 5.2 No fix listed
pypi pyinstaller(PyPI) = 5.3 No fix listed
pypi pyinstaller(PyPI) = 5.4 No fix listed
pypi pyinstaller(PyPI) = 5.4.1 No fix listed
pypi pyinstaller(PyPI) = 5.5 No fix listed
pypi pyinstaller(PyPI) = 5.6 No fix listed
pypi pyinstaller(PyPI) = 5.6.1 No fix listed
pypi pyinstaller(PyPI) = 5.6.2 No fix listed
pypi pyinstaller(PyPI) = 5.7.0 No fix listed
pypi pyinstaller(PyPI) = 5.8.0 No fix listed
pypi pyinstaller(PyPI) = 5.9.0 No fix listed
pyinstaller = < 5.13.1 No fix listed
pyinstaller < 5.13.1 5.13.1

References