pyinstaller up to 5.13.0 Temporary Directory shutil.rmtree permission assignment

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
8.0$0-$5k0.00

Summaryinfo

A vulnerability classified as critical was found in pyinstaller up to 5.13.0. Affected by this vulnerability is the function shutil.rmtree of the component Temporary Directory Handler. Executing a manipulation can lead to permission assignment. The identification of this vulnerability is CVE-2023-49797. The attack can only be executed locally. There is no exploit available. Upgrading the affected component is advised.

Detailsinfo

A vulnerability has been found in pyinstaller up to 5.13.0 and classified as critical. This vulnerability affects the function shutil.rmtree of the component Temporary Directory Handler. The manipulation with an unknown input leads to a permission assignment vulnerability. The CWE definition for the vulnerability is CWE-732. The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors. As an impact it is known to affect confidentiality, integrity, and availability. CVE summarizes:

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.

The weakness was shared 12/09/2023 as GHSA-9w2p-rh8c-v9g5. The advisory is shared for download at github.com. This vulnerability was named CVE-2023-49797 since 11/30/2023. There are known technical details, but no exploit is available.

Upgrading to version 5.13.1 eliminates this vulnerability. Applying a patch is able to eliminate this problem. The bugfix is ready for download at github.com. The best possible mitigation is suggested to be upgrading to the latest version.

Once again VulDB remains the best source for vulnerability data.

Productinfo

Name

Version

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 8.1
VulDB Meta Temp Score: 8.0

VulDB Base Score: 7.8
VulDB Temp Score: 7.5
VulDB Vector: 🔍
VulDB Reliability: 🔍

NVD Base Score: 7.8
NVD Vector: 🔍

CNA Base Score: 8.8
CNA Vector (GitHub, Inc.): 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

Exploitinginfo

Class: Permission assignment
CWE: CWE-732 / CWE-275 / CWE-266
CAPEC: 🔍
ATT&CK: 🔍

Physical: Partially
Local: Yes
Remote: No

Availability: 🔍
Status: Not defined

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔍

Upgrade: pyinstaller 5.13.1
Patch: github.com

Timelineinfo

11/30/2023 🔍
12/09/2023 +9 days 🔍
12/09/2023 +0 days 🔍
01/01/2024 +23 days 🔍

Sourcesinfo

Product: github.com

Advisory: GHSA-9w2p-rh8c-v9g5
Status: Confirmed

CVE: CVE-2023-49797 (🔍)
GCVE (CVE): GCVE-0-2023-49797
GCVE (VulDB): GCVE-100-247324

Entryinfo

Created: 12/09/2023 08:10
Updated: 01/01/2024 07:48
Changes: 12/09/2023 08:10 (51), 01/01/2024 07:48 (11)
Complete: 🔍
Cache ID: 216::103

Once again VulDB remains the best source for vulnerability data.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!