CVE-2024-57656
Executive Summary
CVE-2024-57656 is a denial-of-service (DoS) vulnerability in the sqlc_add_distinct_node component of OpenLink Virtuoso Open-Source edition, version 7.2.11. An attacker can trigger this issue by sending crafted SQL statements, causing the database server to crash or become unresponsive. The vulnerability has a CVSS score of 0.0 (unscored) and an EPSS probability of 0.0%, indicating low exploitation likelihood at this time. No public exploit code, patch, or GitHub advisory is available. The vendor has not released a fix.
This vulnerability is not related to any WordPress plugin or component; it is a core database engine issue.
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
This vulnerability affects the OpenLink Virtuoso Open-Source package, which is distributed as source code and pre-built binaries. Organizations using Virtuoso in their supply chain (e.g., as a data integration or graph database component) should assess their exposure. No package-specific mitigations (e.g., PyPI, NPM) are available.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Unscored)
- Vector: UNKNOWN
- Attack Vector (AV): Network (likely)
- Attack Complexity (AC): Low (likely)
- Privileges Required (PR): None (likely)
- User Interaction (UI): None (likely)
- Scope (S): Unchanged
- Confidentiality (C): None
- Integrity (I): None
- Availability (A): High
- EPSS Score: 0.0% (low probability of exploitation)
- Threat Level: Medium (due to potential for DoS, but low exploitation probability)
Deep Dive & Mechanics
The vulnerability resides in the sqlc_add_distinct_node function within the Virtuoso SQL compiler. This function is responsible for processing DISTINCT clauses in SQL queries. When a specially crafted SQL statement is executed, the function enters an infinite loop or triggers a memory corruption, leading to a crash or hang of the Virtuoso server process.
Root Cause: Improper handling of malformed or deeply nested DISTINCT clauses. The function fails to validate the structure of the query tree, allowing an attacker to construct a query that causes uncontrolled recursion or resource exhaustion.
Attack Vector: An unauthenticated attacker can send a malicious SQL query over the network to the Virtuoso server (typically listening on port 1111 or 8890 for HTTP/SOAP endpoints). No authentication is required if the server is exposed.
Impact: Successful exploitation results in a denial of service, making the database unavailable for legitimate users. In clustered deployments, this could affect multiple nodes.
Vulnerable vs. Patched Code
No patched code is available. The vulnerable code is in the sqlc_add_distinct_node function of the Virtuoso source tree (file sqlcomp.c or similar). The function likely processes a linked list or tree of query nodes without proper depth or cycle detection.
Vulnerable Code (Conceptual):
// Simplified vulnerable logic
void sqlc_add_distinct_node(QueryNode *node) {
while (node != NULL) {
// Process node
node = node->next; // No cycle detection
}
}
Patched Code (Hypothetical):
// Patched logic with depth limit
void sqlc_add_distinct_node(QueryNode *node, int depth) {
if (depth > MAX_DEPTH) {
sql_error("Query too complex");
return;
}
while (node != NULL) {
// Process node
node = node->next;
}
}
Exploitation & Lab Setup
Red Team
No public exploit code is available. To reproduce the DoS, an attacker would craft a SQL query with a deeply nested or cyclic DISTINCT clause. Example:
SELECT DISTINCT * FROM (SELECT DISTINCT * FROM (SELECT DISTINCT * FROM ...)) AS t;
Lab Setup:
- Install Virtuoso Open-Source v7.2.11 on a Linux VM.
- Start the server with default configuration.
- Connect via
isqlor a SQL client. - Execute the crafted query.
Expected Outcome: The Virtuoso server process crashes or becomes unresponsive.
Blue Team
Detection:
- Monitor for SQL queries with excessive nesting or repeated
DISTINCTkeywords. - Use database audit logs to capture query patterns.
- Implement rate limiting on SQL connections.
Mitigation:
- Restrict network access to the Virtuoso server (firewall rules).
- Use a Web Application Firewall (WAF) to filter suspicious SQL patterns.
- Apply vendor patch when available.
Indicators of Compromise (IOCs)
- Network: SQL queries containing multiple nested
DISTINCTclauses. - Logs: Virtuoso error logs showing "out of memory" or "stack overflow" errors.
- Process: Virtuoso server process crash or high CPU usage.
- File: Core dumps in the Virtuoso data directory.
Detection Engineering
YARA Rule
rule CVE_2024_57656_Virtuoso_DoS {
meta:
description = "Detects SQL queries exploiting CVE-2024-57656 in Virtuoso"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2024-57656"
strings:
$sql_pattern = /SELECT\s+DISTINCT.*DISTINCT.*DISTINCT/i
condition:
$sql_pattern
}
Sigma Rule
title: CVE-2024-57656 Virtuoso DoS via Crafted SQL
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects SQL queries with multiple nested DISTINCT clauses targeting Virtuoso
author: Valters IT
date: 2025-04-17
logsource:
category: application
product: virtuoso
detection:
selection:
Query|contains|all:
- 'SELECT DISTINCT'
- 'DISTINCT'
condition: selection | count(Query) > 3
falsepositives:
- Legitimate complex queries (rare)
level: high
Suricata Rule
alert tcp $EXTERNAL_NET any -> $HOME_NET 1111 (msg:"CVE-2024-57656 Virtuoso DoS Attempt"; flow:to_server,established; content:"SELECT DISTINCT"; nocase; content:"DISTINCT"; distance:0; within:100; threshold:type both, track by_src, count 3, seconds 60; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Restrict network access to the Virtuoso server using firewall rules.
- Monitor for suspicious SQL queries with excessive nesting.
- Implement connection rate limiting.
Long-Term Fix:
- Apply vendor patch when released.
- Upgrade to a patched version of Virtuoso Open-Source.
- Consider using a Web Application Firewall (WAF) to filter malicious SQL patterns.
Workaround:
- Disable the
DISTINCTclause functionality if not required (not recommended for production).
Valters IT
DevSecOps & Cyber Threat Intelligence