CVE-2022-23522 Arbitrary File Write when Extracting Tarballs retrieved from a remote location using in mindsdb
Attackers can overwrite system files by serving malicious tarballs to MindsDB, potentially leading to code execution or data modification.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-23522?
CVE-2022-23522 is a high-severity path traversal vulnerability in mindsdb, published on 30 Mar 2023. Any signed-in user can exploit it over the network, with no action from the victim.
Official 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 vulnerability 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. This issue has been addressed in version 22.11.4.3. Users are advised to upgrade. Users unable to upgrade should avoid ingesting archives from untrusted sources.
Weakness: CWE-22
Which versions are affected by CVE-2022-23522?
3 open source packages ship an affected version, including mindsdb. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
mindsdb PyPI | All versions | 22.11.4.3 |
mindsdb PyPI | All versions | 22.11.4.3 |
mindsdb PyPI | All versions | 22.11.4.3 |
Products include Mindsdb Mindsdb.
How do I fix CVE-2022-23522?
Upgrade mindsdb to 22.11.4.3 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2022-23522 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-23522 exists.
Other vulnerabilities in mindsdb
- CVE-2024-24759 MindsDB Vulnerable to Bypass of SSRF Protection with DNS Rebinding
- CVE-2023-50731 MindsDB has arbitrary file write in file.py
- CVE-2023-38699 MindsDB 'Call to requests with verify=False disabling SSL certificate checks, security issue.' issue
- CVE-2024-45856 MindsDB Cross-site Scripting vulnerability
- CVE-2026-27483 MindsDB has Path Traversal in /api/files Leading to Remote Code Execution
Sources
Also known as GHSA-7x45-phmr-9wqp, PYSEC-2023-26.