The vulnerability is a classic error-based SQL injection in the bulk operations of the Scadenzario module. The root cause is the failure to properly sanitize user-provided input before incorporating it into a database query.
The exploitation flow begins when an authenticated user sends a POST request to /actions.php with a malicious payload in the id_records[] parameter. The actions.php script retrieves this array and passes it to the array_clean() function located in lib/util.php. This function is flawed as it only removes empty values but does not validate the data type, allowing SQL injection payloads to remain.
Subsequently, actions.php includes /modules/scadenzario/bulk.php. Inside this file, the unsanitized $id_records array is directly concatenated into a SQL SELECT statement using implode(',', $id_records). This dynamically constructed query is then executed by the $database->FetchArray() method. The lack of input validation and use of prepared statements at this stage allows an attacker to inject malicious SQL and exfiltrate database contents, such as user credentials and financial records, by manipulating the database to return information within error messages.