Summary
OpenSTAManager versions prior to 2.10.2 contain an SQL injection vulnerability in multiple confronta_righe.php module files, where the righe parameter is directly concatenated into SQL queries.
An authenticated attacker who can control this parameter may inject arbitrary SQL statements, enabling unauthorized access to sensitive database contents such as user credentials, customer records, and invoice data.
Affected context
This vulnerability occurs in OpenSTAManager deployments that expose confronta_righe.php endpoints within various modules and accept the righe parameter via HTTP GET requests.
It becomes relevant when authenticated users can influence this parameter and the application constructs SQL queries by directly appending its value without using safe query mechanisms.
Typical environments include shared hosting or on-premise servers where the web application communicates with a relational database storing operational, customer, and billing data.
Exploit preconditions
- Attack surface: Web application endpoints implemented by confronta_righe.php across affected modules.
- Required access: Authenticated access to OpenSTAManager with permission to reach the functionality that triggers confronta_righe.php.
- Input control: Ability to manipulate the righe parameter in the URL query string (e.g., via browser, proxy, or crafted HTTP requests).
- Trigger point: Execution of the underlying SQL query where righe is concatenated directly into the query string.
- Why exploitation is possible: The application interpolates user-supplied righe values directly into SQL statements without sanitization, validation, or prepared statements, allowing attacker-controlled tokens to alter the query structure.
Why this happens
The root cause is direct string concatenation of untrusted input into SQL queries, a classic instance of CWE-89 (Improper Neutralization of Special Elements used in an SQL Command).
In the affected confronta_righe.php files, the righe parameter from $_GET['righe'] is treated as safe and appended to the query text, allowing input to escape intended data boundaries and inject additional SQL clauses or statements.
This pattern arises when application logic mixes query construction with user input handling instead of using parameterized queries or binding APIs that distinguish between code and data.
Potential impact
- Unauthorized reading of sensitive database contents, including user accounts and password hashes.
- Exposure of customer information such as contact details, service histories, and contractual data.
- Disclosure or manipulation of financial and invoice records, potentially impacting accounting integrity.
- Enumeration of internal schema details (tables, columns) that could aid further attacks.
- Chaining with other weaknesses (e.g., weak password hashing) to escalate compromise beyond the database layer.
General mitigation guidance
Effective mitigation focuses on eliminating direct use of user input in query strings and tightening data handling practices:
- Refactor database access to use parameterized queries or prepared statements provided by the database abstraction layer.
- Introduce strict input validation for parameters like righe, constraining them to expected formats (e.g., numeric IDs or whitelisted tokens).
- Centralize query construction in a data access layer where dangerous concatenation is prohibited by convention or code review policy.
- Apply least-privilege principles to database accounts so that application users have only the minimal required permissions.
- Implement defense-in-depth with application-level error handling that avoids returning raw database errors or query fragments to clients.
How teams detect issues like this
Organizations can detect similar vulnerabilities with a combination of code-centric and behavior-centric techniques:
- Use static analysis tools configured with rules that flag SQL queries built via string concatenation or interpolation, especially around
$_GET,$_POST, and similar sources. - During code review, search for direct inclusion of request parameters in SQL strings and enforce patterns that require bound parameters for all variable input.
- Employ runtime application security testing (DAST) to send crafted inputs through the righe parameter and monitor for anomalies such as SQL errors or unexpected response structures.
- Monitor database logs for unusual query patterns, including concatenated fragments, stacked queries, or atypical data extraction from sensitive tables.

