/

CVE-2026-35168

Severity:

HIGH RISK

(8.8)

SQL Injection in OpenSTAManager Aggiornamenti Module

CVE-2026-35168

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Authenticated Arbitrary SQL Execution and Full Database Compromise

Severity:

HIGH RISK

(8.8)

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

The Aggiornamenti (Updates) module in OpenSTAManager accepts a JSON array of raw SQL statements and executes them directly against the database without validation or sanitization.

An authenticated user with access to this module can execute arbitrary SQL commands, enabling complete database compromise and potential data exfiltration or destruction.

Affected context

This vulnerability occurs in OpenSTAManager deployments where the Aggiornamenti (Updates) module is enabled and reachable by authenticated users.

It specifically affects the database conflict resolution operation (op=risolvi-conflitti-database), which is designed to apply update-related SQL changes.

The issue is present when the backend accepts caller-supplied JSON arrays of SQL statements and passes them directly to the MySQL server, with foreign key checks disabled, without applying any allowlist, validation, or sanitization.

Exploit preconditions

  • Attack surface: HTTP(S) endpoint in the Aggiornamenti (Updates) module handling op=risolvi-conflitti-database
  • Required access: Valid authenticated account with permission to access the Aggiornamenti module and trigger database conflict resolution
  • Trigger point: Sending a crafted POST request containing a JSON array of SQL statements to the conflict resolution endpoint
  • Why exploitation is possible: The server directly executes attacker-supplied SQL content, with no filtering or allowlisting, and explicitly disables foreign key checks (SET FOREIGN_KEY_CHECKS=0), removing key integrity safeguards

Why this happens

The core issue is the direct execution of untrusted SQL strings received from the client, which maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection).

Instead of using parameterized queries, predefined migration scripts, or a controlled set of database operations, the application treats client-supplied data as executable SQL logic.

The conflict resolution feature implicitly assumes that the caller is trusted to provide safe SQL statements, collapsing the separation between data and code and enabling arbitrary query execution.

Potential impact

  • Attacker may create, alter, or drop tables, indexes, and other schema objects
  • Attacker may insert, update, or delete arbitrary application data, leading to data corruption or loss
  • Attacker can read sensitive data across the entire database, including user records and business information
  • Attacker could leverage SELECT ... INTO OUTFILE or similar commands to exfiltrate database contents to server-accessible files
  • Attacker may disable or bypass application-level integrity constraints by exploiting disabled foreign key checks
  • Attacker can potentially pivot to further system compromise if database-level access controls are weak or if file writes are possible to executable paths

General mitigation guidance

Effective mitigation focuses on removing the ability for clients to submit arbitrary SQL and narrowing the allowed operations to a safe, predefined set:

  • Replace free-form SQL submission with a controlled conflict resolution mechanism that uses parameterized queries and enumerated, server-defined operations (e.g., specific migrations or fixups).
  • Introduce an allowlist of permissible actions or migration identifiers rather than accepting raw SQL text from the client.
  • Enforce strict server-side validation of any database changes, ensuring that the client cannot directly influence the SQL text.
  • Maintain foreign key checks and other integrity constraints wherever feasible, relying on database protections rather than disabling them for convenience.
  • Apply least-privilege principles to the database account used by the application so that even if an issue arises, the account cannot perform dangerous operations such as DROP, ALTER, or file I/O.
  • Limit access to administrative or update modules to narrowly scoped, highly trusted roles, and require strong authentication and, where appropriate, additional approval workflows.

How teams detect issues like this

Detection typically involves a combination of code-level review and runtime monitoring:

  • Static analysis and code review:
  • Search for endpoints that accept SQL text or large free-form strings from HTTP requests and pass them to database execution APIs (query, exec, etc.).
  • Flag any use of string concatenation for building SQL statements based on request parameters, especially in administrative modules.
  • Review any "update", "migration", or "maintenance" paths for patterns that accept client-provided SQL or administrative commands.
  • Policy and architectural checks:
  • Establish coding standards that prohibit execution of client-supplied SQL and mandate parameterized queries for all database access.
  • Enforce design reviews for modules that perform schema changes or conflict resolution, with explicit verification that only server-defined operations are allowed.
  • Runtime and logging:
  • Enable detailed database logging for administrative and update operations to detect unusual or broad SQL activity (e.g., unexpected DROP, ALTER, or SELECT ... INTO OUTFILE commands).
  • Monitor HTTP logs for suspicious payloads targeting conflict resolution or update endpoints.
  • Automated code review and security scanning tools can assist by flagging patterns where HTTP input flows directly into SQL execution APIs without sanitization or parameterization.

Sources

SourceLink
github.comgithub.com/devcode-it/openstamanager/commit/43970676bcd6636ff8663652fd82579f737abb74
github.comgithub.com/devcode-it/openstamanager/releases/tag/v2.10.2
github.comgithub.com/devcode-it/openstamanager/security/advisories/GHSA-2fr7-cc4f-wh98

Frequently asked

questions

Yes, if the OpenSTAManager instance is exposed over the network and the Aggiornamenti module is reachable, a remote authenticated user with the appropriate permissions can exploit it by sending crafted HTTP requests.

The attacker must have an authenticated account with access to the Aggiornamenti (Updates) module and the database conflict resolution functionality. The exact role or permission level depends on how access controls are configured in the deployment.

The safest pattern is to remove the capability for clients to submit arbitrary SQL entirely. Instead, implement server-controlled conflict resolution using parameterized queries, predefined migration scripts, or a constrained set of operations chosen on the server side rather than provided by the client.

Avoid any design where client input is treated as executable SQL or code, enforce parameterized queries throughout the codebase, and require architectural reviews for administrative or update features. Combine these with strict least-privilege database accounts and coding standards that explicitly forbid free-form SQL acceptance from users.

Find out what's already
exploitable in your codebase.