The Aggiornamenti (Updates) module in OpenSTAManager <= 2.10.1 contains a database conflict resolution feature (op=risolvi-conflitti-database) that accepts a JSON array of SQL statements via POST and executes them directly against the database without any validation, allowlist, or sanitization.
An authenticated attacker with access to the Aggiornamenti module can execute arbitrary SQL statements including CREATE, DROP, ALTER, INSERT, UPDATE, DELETE, SELECT INTO OUTFILE, and any other SQL command supported by the MySQL server. Foreign key checks are explicitly disabled before execution (SET FOREIGN_KEY_CHECKS=0), further reducing database integrity protections.
File: modules/aggiornamenti/actions.php, lines 40-82
case 'risolvi-conflitti-database':
$queries_json = post('queries'); // Line 41: User input from POST
// ...
$queries = json_decode($queries_json, true); // Line 50: JSON decoded to array
// ...
$dbo->query('SET FOREIGN_KEY_CHECKS=0'); // Line 69: FK checks DISABLED
$errors = [];
$executed = 0;
foreach ($queries as $query) {
try {
$dbo->query($query); // Line 76: DIRECT EXECUTION
++$executed;
} catch (Exception $e) {
$errors[] = $query.' - '.$e->getMessage(); // Line 79: Error details leaked
}
}
$dbo->query('SET FOREIGN_KEY_CHECKS=1'); // Line 82: FK checks re-enabled
$dbo->query() without any validation or filtering.ALTER TABLE or CREATE INDEX).SET FOREIGN_KEY_CHECKS=0 is executed before the user queries, allowing data integrity violations.2.10.2Exploitability
AV:NAC:LPR:LUI:NScope
S:UImpact
C:HI:HA:H8.8/CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H