CVE-2019-16784 Local Privilege Escalation present only on the Windows version of PyInstaller
Local attackers can escalate privileges on Windows if PyInstaller onefile apps run as privileged users with world-writable temp directories.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2019-16784?
CVE-2019-16784 is a high-severity vulnerability in PyInstaller, published on 14 Jan 2020. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In PyInstaller before version 3.6, only on Windows, a local privilege escalation vulnerability is present in this particular case: If a software using PyInstaller in "onefile" mode is launched by a privileged user (at least more than the current one) which have his "TempPath" resolving to a world writable directory. This is the case for example if the software is launched as a service or as a scheduled task using a system account (TempPath will be C:\Windows\Temp). In order to be exploitable the software has to be (re)started after the attacker launch the exploit program, so for a service launched at startup, a service restart is needed (e.g. after a crash or an upgrade).
Which versions are affected by CVE-2019-16784?
3 open source packages ship an affected version, including pyinstaller and PyInstaller. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pyinstaller PyPI | All versions | 3.6 |
pyinstaller PyPI | All versions | 3.6 |
PyInstaller PyPI | All versions | 3.6 |
Products include Pyinstaller Pyinstaller.
How do I fix CVE-2019-16784?
Upgrade pyinstaller to 3.6 or later.
Is CVE-2019-16784 being exploited?
There is no known exploitation of CVE-2019-16784 in the wild and no public exploit code.
Public exploit code: 2 proofs of concept on GitHub.
Other vulnerabilities in PyInstaller
Sources
Also known as GHSA-7fcj-pq9j-wh2r, PYSEC-2020-175.