/

CVE-2025-61023

Severity:

HIGH RISK

(7.5)

SQL Injection (CWE-89) in Virtuoso st_compare Component

CVE-2025-61023

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Denial of Service via 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 flaw in the st_compare component of Virtuoso Open-Source 7.2.11 allows crafted SQL statements to disrupt normal database processing.

When an attacker can influence SQL input reaching st_compare, they may trigger conditions that lead to resource exhaustion and denial of service.

Affected context

This vulnerability occurs in deployments where Virtuoso Open-Source 7.2.11 is exposed to SQL queries that can be influenced by untrusted or partially trusted users or applications.

It is most relevant in contexts where application logic forwards user-controlled parameters into SQL statements invoking the st_compare component without robust validation or parameterization.

The risk increases when the database is directly exposed to external clients or when internal services lack strict query construction controls.

Exploit preconditions

  • Attack surface: SQL query interface to the Virtuoso database (e.g., application-driven queries, interactive consoles, or external clients).
  • Required access: Ability to submit or indirectly influence SQL statements that reach the st_compare component.
  • Trigger point: Execution of crafted SQL that causes st_compare to process malformed or unexpected input patterns.
  • Why exploitation is possible: User-controlled data is incorporated into SQL statements without safe parameterization or constraints, allowing attackers to manipulate query structure and stress internal processing.

Why this happens

The root cause aligns with CWE-89 (Improper Neutralization of Special Elements used in an SQL Command), where user input is embedded directly into SQL statements without adequate sanitization or parameterization.

Within the st_compare component, assumptions about the shape, size, or semantics of incoming SQL lead to unsafe handling when that input is attacker-controlled.

The component likely performs complex comparison or transformation logic that can be driven into pathological states, such as expensive computations or abnormal execution paths, resulting in Denial of Service under load.

Potential impact

  • Attackers may cause the database server to consume excessive CPU or memory.
  • The Virtuoso instance could become unresponsive to legitimate queries.
  • Dependent applications may experience outages or severe performance degradation.
  • System operators may need to restart services, potentially causing data processing delays.

General mitigation guidance

Mitigation should focus on hardening how SQL statements are constructed and processed before they reach components like st_compare.

Common defensive patterns include:

  • Using parameterized queries or prepared statements instead of string concatenation for SQL construction.
  • Enforcing strict validation and normalization of input that influences SQL commands, especially complex comparison operations.
  • Applying query-level controls such as limits, timeouts, and resource caps to reduce the impact of pathological statements.
  • Segregating privileges so that interfaces exposed to untrusted users have constrained capabilities and cannot issue arbitrarily complex SQL.
  • Designing application layers to treat all external input as untrusted, applying filtering and schema-based constraints prior to building database queries.

How teams detect issues like this

High-level detection approaches may include:

  • Static analysis rules targeting unsafe SQL construction patterns (e.g., string concatenation with user input) in application code that interacts with Virtuoso.
  • Code review practices that flag direct injection of untrusted data into SQL, especially where st_compare or similar components are involved.
  • Monitoring database logs and performance metrics for recurring complex or malformed queries that correlate with service degradation.
  • Implementing policy-based query gateways or ORM-level constraints that restrict dangerous query shapes and enforce parameterization.
  • Using automated security testing tools to fuzz SQL interfaces and identify inputs that lead to abnormal resource consumption or timeouts.

Sources

SourceLink
github.comgithub.com/openlink/virtuoso-opensource/issues/1230
access.redhat.comaccess.redhat.com/security/cve/CVE-2025-61023
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2491803
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-61023.json

Frequently asked

questions

The reported behavior focuses on Denial of Service via crafted SQL statements. While CWE-89 can sometimes enable data access or modification, in this case the primary observed impact is service disruption rather than direct data exfiltration.

An attacker must be able to submit or indirectly influence SQL statements that the Virtuoso server executes. This may occur through web application inputs, API parameters, or any interface that ultimately issues queries leveraging the st_compare component.

The most robust fix pattern is to eliminate unsafe query construction by using parameterized statements, enforcing strict input validation, and applying principle-of-least-privilege on database interfaces so that untrusted users cannot craft arbitrary or overly complex SQL.

Organizations can adopt secure coding standards for database access, integrate static analysis to detect injection patterns, enforce query constraints and resource limits at the database layer, and include targeted security tests that attempt to drive query components into high-cost or error-prone states.

Find out what's already
exploitable in your codebase.