CVE-2024-45847·Python vulnerability
An arbitrary code execution vulnerability exists in versions 23.11.4.2 up to 24.7.4.1 of the MindsDB platform, when one of several integrations is installed on the server. If a specially crafted ‘UPDATE’ query containing Python code is run against a database created with the specified integration engine, the code will be passed to an eval function and executed on the server.
- Severity
- high
- Software
- Python
- Fixed in
- 24.7.4.1
- Published
- 2024-09-12
Affected versions
From: 23.11.4.2
Until: 24.7.4.1
Fixed in: 24.7.4.1
How to fix this CVE
Update MindsDB to version 24.7.4.1 or later to eliminate the arbitrary code execution risk introduced by unsafe eval() usage in UPDATE query handling. Organizations running MindsDB versions 23.11.4.2 through 24.7.4.0 with active database integrations should prioritize this patch, as the vulnerability allows authenticated users to execute arbitrary Python code on the server through specially crafted SQL queries.
sudo dnf update python3 -yDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
UPDATE .* (SET|VALUES).*(import|exec\(|eval\(|__import__|subprocess|os\.system|compile\()WAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Block or rate-limit UPDATE queries containing suspicious Python keywords (import, exec, eval, __import__, subprocess, os.system) in the request body or parameters. Implement query whitelisting to permit only expected UPDATE patterns against MindsDB databases.How to check if you are affected
- Run `python3 --version` and `pip3 list | grep -i mindsdb` to confirm MindsDB installation and version
- Check MindsDB config file (typically ~/.mindsdb/config.json or /etc/mindsdb/config.json) to identify which database integrations are enabled
- Search application logs for UPDATE queries containing Python syntax like 'import', 'exec(', 'eval(', '__import__', or 'subprocess' in the query payload
- Verify the fix by re-running `pip3 show mindsdb` and confirming the version is 24.7.4.1 or higher
FAQ
What is CVE-2024-45847?
CVE-2024-45847 is a critical remote code execution flaw in MindsDB that allows authenticated database users to inject and execute arbitrary Python code through malformed UPDATE statements. The vulnerability stems from the platform passing unsanitized user input directly to Python's eval() function without proper validation.
Is CVE-2024-45847 being actively exploited?
As of the latest advisory, CVE-2024-45847 is not listed on the CISA Known Exploited Vulnerabilities catalog, and no public exploit code has been released. However, the vulnerability requires only low privileges and straightforward attack mechanics, making it likely to be weaponized.
What versions of MindsDB are affected by CVE-2024-45847?
MindsDB versions 23.11.4.2 through 24.7.4.0 are vulnerable. Version 24.7.4.1 and all subsequent releases include the remediation.
How do I check if my server is vulnerable to CVE-2024-45847?
Run `pip3 show mindsdb | grep Version` and compare against the vulnerable range (23.11.4.2 to 24.7.4.0). If your version falls within this range and you have database integrations enabled, your deployment is at risk.
Does Defensia detect CVE-2024-45847?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If MindsDB is installed on a monitored server, CVE-2024-45847 will appear in your dashboard with remediation steps.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-45847. Free for 1 server.
Get started free