PT-2023-12725 · Mindsdb · Mindsdb

Sim4N6

+1

·

Published

2023-03-30

·

Updated

2023-04-10

·

CVE-2022-23522

CVSS v3.1

8.5

High

VectorAV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N
Name of the Vulnerable Software and Affected Versions MindsDB versions prior to 22.11.4.3
Description MindsDB is an open source machine learning platform. An unsafe extraction is being performed using shutil.unpack archive() from a remotely retrieved tarball, which may lead to the writing of the extracted files to an unintended location. This issue is sometimes called a TarSlip or a ZipSlip variant. Unpacking files using the high-level function shutil.unpack archive() from a potentially malicious tarball without validating that the destination file path remained within the intended destination directory may cause files to be overwritten outside the destination directory. An attacker could craft a malicious tarball with a filename path, such as ../../../../../../../../etc/passwd, and then serve the archive remotely using a personal bucket s3, thus, retrieve the tarball through MindsDB and overwrite the system files of the hosting server.
Recommendations For versions prior to 22.11.4.3, upgrade to version 22.11.4.3 or later to address the issue. As a temporary workaround, consider validating the location of the extracted files and discard those with malicious paths such as relative path .. or absolute path such as /etc/password. Additionally, using a safer module like zipfile can help mitigate the issue. Avoid ingesting archives from untrusted sources until the issue is resolved.

Exploit

Fix

Path traversal

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2022-23522
GHSA-7X45-PHMR-9WQP
PYSEC-2023-26

Affected Products

Mindsdb