CVE-2023-50731: GHSL-2023-182_GHSL-2023-184: Server-side request forgery (SSRF), arbitrary file write and limited file write vulnerabilities in mindsdb/mindsdb - CVE-2023-49795, CVE-2023-50731, CVE-2023-49796

Published Dec 15, 2023
·
Updated

Impact

Issue: Arbitrary file write in file.py (GHSL-2023-183)

Patches

Use mindsdb staging branch or v23.11.4.1

Other sources

MindsDB is a SQL Server for artificial intelligence. Prior to version 23.11.4.1, the put method in mindsdb/mindsdb/api/http/namespaces/file.py does not validate the user-controlled name value, which is used in a temporary file name, which is afterwards opened for writing on lines 122-125, which leads to path injection. Later in the method, the temporary directory is deleted on line 151, but since we can write outside of the directory using the path injection vulnerability, the potentially dangerous file is not deleted. Arbitrary file contents can be written due to f.write(chunk) on line 125. Mindsdb does check later on line 149 in the savefile method in file-controller.py which calls the handlesource method in filehandler.py if a file is of one of the types csv, json, parquet, xls, or xlsx. However, since the check happens after the file has already been written, the files will still exist (and will not be removed due to the path injection described earlier), just the handlesource method will return an error. The same user-controlled source source is used also in another path injection sink on line 138. This leads to another path injection, which allows an attacker to delete any zip or tar.gz files on the server.

MITRE

Three vulnerabilities that can be exploited by unauthenticated users were found in MindsDB: a Server-side request forgery (SSRF) vulnerability, an arbitrary file write vulnerability and a limited file write vulnerability.

GitHub Security Lab

Affected Software

2 affected componentsFixes available
pip/mindsdb<23.7.4.1
23.11.4.1
MindsDB MindsDB<23.11.4.1

Event History

Dec 15, 2023
Advisory Published
via GitHub·04:02 AM
Dec 21, 2023
Advisory Published
via GitHub Security Lab·12:00 AM
Data Sourced
via GitHub Security Lab·12:00 AM
Description
Dec 22, 2023
CVE Published
via MITRE·08:43 PM
Data Sourced
via MITRE·08:43 PM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2023-50731?

CVE-2023-50731 has a high severity level due to its potential to allow arbitrary file write operations.

2

How do I fix CVE-2023-50731?

To fix CVE-2023-50731, upgrade to MindsDB version 23.11.4.1 or use the staging branch.

3

Which versions of MindsDB are affected by CVE-2023-50731?

Versions of MindsDB prior to 23.11.4.1 are affected by CVE-2023-50731.

4

What kind of vulnerability is CVE-2023-50731?

CVE-2023-50731 is an arbitrary file write vulnerability in the file.py component of MindsDB.

5

Where can I find more information about CVE-2023-50731?

You can refer to the MindsDB GitHub repository for detailed information regarding CVE-2023-50731.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203