OpenSTAManager Prima Nota Error-Based SQL Injection — CVE-2026-24419
by Łukasz Rybak (lukasz-rybak) · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-24419
- Category
- web
- Affected product
- OpenSTAManager (devcode-it/openstamanager)
- Affected versions
- <= 2.9.8
- Disclosed
- 2026-07-05
- Patch status
- patched
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-04 |
| Author / Researcher | Łukasz Rybak (lukasz-rybak) |
| CVE / Advisory | CVE-2026-24419 |
| Category | web |
| Severity | High |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | sql-injection, error-based, openstamanager, php, extractvalue, credential-theft, authenticated |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | OpenSTAManager (devcode-it/openstamanager) |
| Versions Affected | <= 2.9.8 |
| Language / Platform | PHP web application; PoC written in Bash (curl) |
| Authentication Required | Yes (any valid authenticated user) |
| Network Access Required | Yes |
Summary
The Prima Nota (journal entry) module’s add.php reads the id_documenti GET parameter, splits it on commas with explode(), but never validates that the resulting elements are integers before imploding them back into a SQL IN() clause used to look up idanagrafica from co_documenti. An authenticated attacker can supply a crafted value such as 1) AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT ...)))# to break out of the intended numeric context and trigger an XPATH syntax error whose message discloses the result of an arbitrary subquery — for example the database user and version. This is a classic error-based SQL injection that requires no time-based inference, making extraction fast and reliable.
Vulnerability Details
Root Cause
/modules/primanota/add.php (lines ~63-67) retrieves id_documenti via get() and calls explode(',', (string) $id_documenti) without validating that elements are integers; line ~306 then implode()s the array directly into a SQL IN() clause without using prepare(), allowing injected SQL to reach the query.
Attack Vector
- Authenticate to OpenSTAManager with any valid user account.
- Send a GET request to
/modules/primanota/add.phpwithid_documenti=1) AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT CONCAT(USER(),' | ',VERSION()))))#. - Read the resulting XPATH syntax error in the HTTP response, which embeds the subquery result (e.g.
~osm@172.18.0.3 | 8.3.0). - Substitute arbitrary subqueries (e.g. against
zz_users) and chunk long results withSUBSTRING()to exfiltrate credentials and other sensitive data.
Impact
Direct, low-effort extraction of database contents (user credentials, customer PII, financial records) by any authenticated user via a single crafted request per data point.
Environment / Lab Setup
Target: OpenSTAManager <= 2.9.8 (PHP/MySQL), e.g. http://localhost:8081
Attacker: curl
Proof of Concept
PoC Script
See
poc_primanota_sqli.shin this folder.
| |
The script logs in and sends a single GET request with an EXTRACTVALUE()-based payload in id_documenti, printing the resulting XPATH error that discloses the database user and version.
Detection & Indicators of Compromise
GET /modules/primanota/add.php?id_documenti=1)%20AND%20EXTRACTVALUE(...)%23
SQLSTATE[HY000]: General error: 1105 XPATH syntax error: '~<leaked data>'
Signs of compromise:
- Requests to
/modules/primanota/add.phpwithid_documentivalues containing),AND,EXTRACTVALUE(/UPDATEXML(rather than plain comma-separated integers. - Repeated near-identical requests differing only in
SUBSTRING()offsets (indicates scripted data extraction). - MySQL error logs showing XPATH syntax errors correlated with Prima Nota module access.
Remediation
| Action | Detail |
|---|---|
| Primary fix | Validate/cast all id_documenti elements as integers (e.g. array_map('intval', ...) plus filtering non-positive values) before use, or use prepare() for the IN() clause — upgrade to a patched OpenSTAManager release once available. |
| Interim mitigation | WAF rule rejecting non-numeric characters in id_documenti; restrict Prima Nota access to trusted roles; monitor for XPATH errors in application logs. |
References
Notes
Mirrored from https://github.com/lukasz-rybak/CVE-2026-24419 on 2026-07-05.
| |