CVE-2024-57662
Executive Summary
CVE-2024-57662 is a denial-of-service (DoS) vulnerability in the sqlg_hash_source component of OpenLink Virtuoso Open-Source v7.2.11. An attacker can trigger a DoS condition by sending crafted SQL statements, leading to resource exhaustion or crash of the database server. No public proof-of-concept (PoC) or patch is currently available. The vulnerability has a low EPSS score (0.0%) and no known exploitation in the wild, but it poses a risk to unpatched Virtuoso instances.
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 binary packages. Users should monitor the official repository for patches and verify the integrity of downloaded packages using checksums or GPG signatures.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (No official vector assigned)
- Attack Vector: Network (likely)
- Attack Complexity: Low (crafted SQL statements)
- Privileges Required: None (if SQL injection is possible)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: None
- Availability Impact: High (DoS)
- Threat Level: Medium (due to DoS potential and lack of patch)
Deep Dive & Mechanics
The vulnerability resides in the sqlg_hash_source component, which is part of Virtuoso's SQL query processing engine. When a specially crafted SQL statement is executed, the component enters an infinite loop or consumes excessive memory, causing the database server to become unresponsive or crash. The exact root cause is likely a flaw in hash table handling or input validation within the sqlg_hash_source function.
Attack Vector: An attacker with network access to the Virtuoso server (typically port 8890 for HTTP/SQL) can send malicious SQL queries. If the server is exposed to the internet, this can be exploited remotely.
Impact: Successful exploitation results in a denial of service, disrupting database operations and any dependent applications.
Vulnerable vs. Patched Code
No patched version is available. The vulnerable code is in the sqlg_hash_source function within the Virtuoso source tree. A hypothetical fix would involve:
- Adding input validation to reject malformed SQL statements.
- Implementing bounds checking and safe hash table operations.
- Introducing resource limits to prevent infinite loops.
Vulnerable Code Snippet (Hypothetical):
// Vulnerable: No bounds checking on input
void sqlg_hash_source(char *input) {
while (*input) {
// Process input without validation
input++;
}
}
Patched Code Snippet (Hypothetical):
// Patched: Added input validation and length check
void sqlg_hash_source(char *input, size_t len) {
if (len > MAX_INPUT_LEN) {
return; // Reject oversized input
}
for (size_t i = 0; i < len; i++) {
if (!is_valid_char(input[i])) {
return; // Reject invalid characters
}
// Process input safely
}
}
Exploitation & Lab Setup
Red Team (Attacker)
Lab Setup:
- Deploy a vulnerable Virtuoso instance (v7.2.11) on a local VM or container.
- Ensure the server is accessible on port 8890.
- Use a SQL client (e.g.,
isql) to connect and send crafted queries.
Exploitation Steps:
- Identify the target Virtuoso server (e.g., via Shodan or port scanning).
- Connect using
isqlor a custom script. - Send a crafted SQL statement that triggers the vulnerability:
-- Example: Malicious query causing infinite loop SELECT * FROM (SELECT 1 UNION SELECT 2) AS t WHERE sqlg_hash_source('A' * 1000000); - Monitor server response; if it becomes unresponsive, the DoS is successful.
Note: No public exploit code is available; this is a hypothetical example.
Blue Team (Defender)
Detection:
- Monitor for unusual SQL queries with excessive length or repetitive patterns.
- Use network monitoring to detect connections to port 8890 from suspicious IPs.
- Implement rate limiting on SQL queries.
Mitigation:
- Restrict network access to Virtuoso servers (firewall rules).
- Apply input validation at the application layer.
- Monitor server logs for crashes or resource exhaustion.
Indicators of Compromise (IOCs)
- Network: Connections to port 8890 (Virtuoso HTTP/SQL) from unknown IPs.
- Logs: Repeated SQL errors or crashes in Virtuoso logs (e.g.,
virtuoso.log). - System: High CPU or memory usage by the
virtuoso-tprocess. - File: Unusual temporary files in
/tmp/or Virtuoso data directories.
Detection Engineering
YARA Rule
rule CVE_2024_57662_Virtuoso_DoS {
meta:
description = "Detects crafted SQL statements targeting CVE-2024-57662"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-57662"
strings:
$sql_pattern = /sqlg_hash_source\s*\(/ nocase
$long_string = /[A-Za-z0-9]{1000,}/
condition:
$sql_pattern and #long_string > 5
}
Sigma Rule
title: CVE-2024-57662 Virtuoso DoS Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects SQL queries with excessive length targeting Virtuoso
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: virtuoso
detection:
selection:
Query|contains: "sqlg_hash_source"
Query|length: >= 10000
condition: selection
falsepositives:
- Legitimate large queries
level: high
Suricata Rule
alert tcp any any -> any 8890 (msg:"CVE-2024-57662 Virtuoso DoS Attempt"; flow:to_server,established; content:"sqlg_hash_source"; nocase; pcre:"/sqlg_hash_source\s*\([^)]{1000,}/"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Restrict network access to Virtuoso servers using firewalls or ACLs.
- Monitor for unusual SQL queries and block suspicious IPs.
- Apply input validation at the application layer to limit query length.
Long-Term Fix:
- Await an official patch from OpenLink. Monitor the Virtuoso GitHub repository or mailing list.
- Consider upgrading to a newer version if a patch is released.
- Implement a Web Application Firewall (WAF) to filter malicious SQL.
Workaround:
- Disable the
sqlg_hash_sourcefunction if not needed (requires code modification). - Use a reverse proxy to limit request sizes.
Valters IT
Securing Digital Frontiers