CVE-2023-49797
Python vulnerability analysis and mitigation

Overview

PyInstaller, a tool that bundles Python applications and their dependencies into a single package, was found to contain a local privilege escalation vulnerability (CVE-2023-49797) in versions prior to 5.13.1. The vulnerability was discovered and disclosed in December 2023, affecting applications built with PyInstaller that contain either matplotlib or win32com components (GitHub Advisory).

Technical details

The vulnerability occurs when a PyInstaller-built application runs with elevated privileges and uses insecure temporary directory handling. The issue specifically manifests when the user's temporary directory is not locked to that specific user (usually due to TMP/TEMP environment variables pointing to an unprotected, arbitrary, non-default location). The vulnerability can be exploited through two methods: either by precisely timing the replacement of a temporary file with a symlink between shutil.rmtree()'s builtin symlink check and the deletion itself, or by exploiting applications built with Python 3.7.x or earlier which lacks protection against Directory Junctions links. The vulnerability has been assigned a CVSS v3.1 score of 8.8 (High) (GitHub Advisory).

Impact

When successfully exploited, this vulnerability allows an unprivileged attacker to trick a privileged process into deleting files that the unprivileged user would not normally have access to. This creates a significant security risk for applications running with elevated privileges (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in PyInstaller version 5.13.1 through PR #7827. Users are strongly advised to upgrade to this version or later. There are no known workarounds for this vulnerability, although the attack complexity becomes significantly higher if the application is built with Python >= 3.8.0 (GitHub Advisory).

Community reactions

The vulnerability has prompted responses from various Linux distributions, with Fedora issuing security updates for affected packages. For example, rdiff-backup was rebuilt in Fedora 38 and 39 to address this vulnerability (Fedora Update).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-22033HIGH8.6
  • PythonPython
  • label-studio
NoNoJan 12, 2026
CVE-2025-68472HIGH8.1
  • PythonPython
  • mindsdb
NoYesJan 12, 2026
CVE-2026-22251MEDIUM5.3
  • PythonPython
  • wlc
NoYesJan 12, 2026
CVE-2026-22691LOW2.7
  • PythonPython
  • pypdf2
NoYesJan 10, 2026
CVE-2026-22250LOW2.5
  • PythonPython
  • wlc
NoYesJan 12, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management