CVE-2019-16784 Local Privilege Escalation present only on the Windows version of PyInstaller

High 7.0 Published Updated

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).

Weakness: CWE-732, CWE-250

Which versions are affected by CVE-2019-16784?

3 open source packages ship an affected version, including pyinstaller and PyInstaller. It affects 1 product.

PackageAffectedFixed in
pyinstaller PyPIAll versions3.6
pyinstaller PyPIAll versions3.6
PyInstaller PyPIAll versions3.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.

Sources

Also known as GHSA-7fcj-pq9j-wh2r, PYSEC-2020-175.

Is CVE-2019-16784 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free