/

CVE-2025-61943

Severity:

HIGH RISK

(8.4)

SQL Injection in Captive Historian Leading to SQL Server

CVE-2025-61943

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Remote Code Execution under SQL Server Administrative Context

Severity:

HIGH RISK

(8.4)

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

An SQL injection vulnerability in Captive Historian allows an authenticated Process Optimization Standard User to tamper with backend queries.

Under specific conditions, this manipulation can lead to code execution with SQL Server administrative privileges, potentially resulting in full compromise of the SQL Server instance.

Affected context

This vulnerability occurs in Captive Historian where user-controlled input from a Process Optimization Standard User role is incorporated into SQL queries executed by the backend without sufficient sanitization or parameterization.

The risk materializes when application functionality exposes query parameters or filters that are concatenated into SQL statements executed by SQL Server with elevated privileges, and where the database configuration permits execution of administrative or OS-level commands via SQL.

Exploit preconditions

  • Attack surface: Application features in Captive Historian that allow users to define, modify, or influence query parameters (e.g., filters, search criteria, report builders).
  • Required access: Authenticated access as a Process Optimization Standard User or any role that can reach the vulnerable query-building functionality.
  • Trigger point: Submission of crafted input that is embedded directly into SQL statements without strict parameterization or proper validation.
  • Why exploitation is possible: The application constructs dynamic SQL using user-influenced data, mapping directly into CWE-89: SQL Injection, and executes those statements with SQL Server administrative privileges, allowing an attacker to escalate their capabilities to code execution.

Why this happens

The root cause lies in constructing SQL statements by concatenating or interpolating user-influenced data instead of using strictly parameterized queries or safe query builders.

When application logic trusts role-based users (such as Process Optimization Standard Users) and fails to treat their inputs as untrusted data, those inputs can alter the structure of SQL commands, inject additional clauses, or call dangerous procedures.

Because the database executes these dynamically built statements with administrative privileges, the injection flaw escalates from data manipulation to full code execution, exemplifying CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Potential impact

  • Execution of arbitrary SQL commands under SQL Server administrative privileges
  • Execution of OS-level commands via SQL Server interfaces, leading to remote code execution
  • Complete compromise of the SQL Server instance, including configuration and stored credentials
  • Unauthorized access, modification, or deletion of historical process data
  • Pivoting from the SQL Server to other internal systems, depending on network layout and trust relationships
  • Data exfiltration of sensitive operational or business information stored in the database

General mitigation guidance

Effective mitigation centers on eliminating dynamic SQL that incorporates user-controlled input and reducing the privileges of database operations:

  • Prefer parameterized queries or stored procedures that strictly separate SQL logic from user-supplied values.
  • Introduce a strong input validation and normalization layer that treats all user-controlled fields as untrusted, even for authenticated roles.
  • Replace ad-hoc dynamic query builders with vetted abstractions that do not allow arbitrary clause injection.
  • Run application database connections with the least privileges necessary, avoiding administrative or sysadmin-level accounts wherever possible.
  • Restrict or disable SQL Server features that enable OS command execution from SQL where not strictly required.
  • Apply defense-in-depth controls such as network segmentation and limiting direct access to SQL Server from untrusted hosts.

How teams detect issues like this

Detection generally combines code-focused review with runtime monitoring:

  • Use static analysis rules to identify string concatenation or formatting operations that construct SQL commands using user input or request parameters.
  • During code review, flag any dynamic SQL patterns, especially those executed under high-privilege database accounts or invoking dangerous procedures.
  • Enforce secure coding policies in CI/CD that require parameterized queries and restrict use of dynamic SQL to carefully reviewed, justified cases.
  • Monitor database logs for anomalous or irregular queries, such as unexpected UNION, EXEC, or system procedure calls originating from application accounts.
  • Employ application-layer security testing (e.g., automated or manual penetration testing) focused on query-building features available to authenticated users.

Sources

SourceLink
github.comgithub.com/cisagov/CSAF/blob/develop/csaf_files/OT/white/2026/icsa-26-015-01.json
softwaresupportsp.aveva.comsoftwaresupportsp.aveva.com/en-US/downloads/products/details/a643eaa3-0d85-4fde-ac11-5239e87a68ea
aveva.comaveva.com/en/support-and-success/cyber-security-updates/
cisa.govcisa.gov/news-events/ics-advisories/icsa-26-015-01

Frequently asked

questions

Yes, if Captive Historian is exposed over the network and an attacker can obtain or already has an account with Process Optimization Standard User privileges, they can attempt to exploit the vulnerable query functionality remotely.

The attacker must be an authenticated user with at least the Process Optimization Standard User role (or any equivalent role that can reach and control the affected query parameters). Anonymous exploitation is unlikely if the vulnerable features are gated behind authentication.

The most robust fix is to replace all dynamic SQL that incorporates user-influenced data with parameterized queries or tightly scoped stored procedures, and to ensure the database account used by the application operates with minimal necessary privileges instead of administrative rights.

Adopt a secure coding standard that mandates parameterized queries, treat all user input as untrusted regardless of role, perform regular security-focused code reviews and automated scanning for SQL injection patterns, and architect database access so that application accounts never require administrative privileges for routine operations.

Find out what's already
exploitable in your codebase.