/

CVE-2025-61019

Severity:

HIGH RISK

(7.5)

SQL Injection (CWE-89) in Virtuoso sqlo_key_part_best

CVE-2025-61019

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Denial of Service via malicious SQL injection

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A SQL injection vulnerability in Virtuoso's sqlo_key_part_best component allows crafted SQL statements to disrupt query processing.

When exposed to untrusted input, this flaw can be abused to trigger resource exhaustion or crashes, resulting in denial of service for dependent applications.

Affected context

The vulnerability occurs in deployments of Virtuoso Open-Source 7.2.11 that accept SQL queries derived from user-controlled or external input.

It is most relevant where applications forward dynamically constructed SQL to the database without strict validation, parameterization, or query-shaping controls.

In such environments, malformed or adversarial SQL can reach the sqlo_key_part_best component and interfere with normal query optimization and execution.

Exploit preconditions

  • Attack surface: Any interface (web app, API, ETL, integration layer) that sends SQL queries to Virtuoso and incorporates untrusted input.
  • Required access: Ability to influence or submit SQL, typically via application-level parameters, forms, or API payloads.
  • Trigger point: Execution of crafted SQL that reaches the sqlo_key_part_best logic during query planning or key-part optimization.
  • Why exploitation is possible: The component does not robustly guard against malformed or adversarial SQL constructs, allowing attackers to push the engine into error states or heavy resource usage, leading to DoS.

Why this happens

This issue aligns with CWE-89, where untrusted data is incorporated into SQL commands without proper neutralization or structural controls.

The sqlo_key_part_best component appears to assume well-formed, benign SQL and does not adequately constrain or validate edge cases introduced by hostile input.

As a result, attackers can supply crafted statements that stress or confuse internal query handling, causing exceptions, hangs, or resource exhaustion rather than safely rejecting the queries.

Potential impact

  • Service may become unresponsive or crash under malicious query load.
  • Database engine can consume excessive CPU or memory, impacting other workloads.
  • Dependent applications and APIs may experience outages or significant performance degradation.
  • Operational teams can face increased recovery time due to repeated restarts or manual intervention.

General mitigation guidance

Effective mitigation focuses on reducing trust in incoming SQL and hardening how applications interact with the database.

Common defensive patterns include:

  • Using parameterized queries or prepared statements instead of building SQL via string concatenation.
  • Applying strict server-side validation and normalization to inputs that influence query structure.
  • Enforcing query-shaping policies (such as whitelisting allowed operations, limits, and patterns) to prevent complex or unexpected constructs.
  • Implementing resource controls and throttling on query execution to reduce the impact of expensive or pathological requests.
  • Applying least-privilege principles to database accounts so that even abused queries have constrained effects.

How teams detect issues like this

Detection typically relies on both code-level and operational signals.

Useful approaches include:

  • Static analysis and linters that flag dynamic SQL construction without parameterization.
  • Code reviews focused on data-access layers, looking for concatenated SQL strings and weak input validation.
  • Database monitoring and logging for anomalous query patterns, repeated errors, or spikes in resource usage tied to specific statements.
  • Policy-based security controls (such as a database firewall or query proxy) that enforce acceptable SQL patterns and block known-bad constructs.

Sources

SourceLink
github.comgithub.com/openlink/virtuoso-opensource/issues/1222

Frequently asked

questions

The described behavior centers on denial of service through crafted SQL. Depending on surrounding application logic and permissions, some SQL injection scenarios may reach data access, but the primary documented impact here is service disruption.

An attacker generally needs the ability to influence or submit SQL queries that are executed by Virtuoso, typically through application-level inputs, API requests, or other data paths that feed into dynamic SQL construction.

The most robust fix is to eliminate dynamic SQL string building with untrusted data, adopting parameterized queries or prepared statements, and enforcing strong validation and strict query-shaping rules for any remaining dynamic behavior.

Preventive strategies include designing data-access layers around safe abstractions, enforcing secure coding guidelines in CI (including automated checks for dynamic SQL), and combining strong input validation with database-level monitoring and resource limits to detect and contain abusive queries early.

Find out what's already
exploitable in your codebase.