GHSA-2jm2-2p35-rp3j

Suggest an improvement
Source
https://github.com/advisories/GHSA-2jm2-2p35-rp3j
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/11/GHSA-2jm2-2p35-rp3j/GHSA-2jm2-2p35-rp3j.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-2jm2-2p35-rp3j
Aliases
Published
2025-11-19T21:00:37Z
Modified
2025-11-19T22:14:24.459283Z
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 Authenticated SQL Injection in API via 'display' parameter
Details

Summary

An authenticated SQL Injection vulnerability in the API allows any user, regardless of permission level, to execute arbitrary SQL queries. By manipulating the display parameter in an API request, an attacker can exfiltrate, modify, or delete any data in the database, leading to a full system compromise.

Details

The vulnerability is located in the retrieve() method within src/API/Manager.php.

User input from the display GET parameter is processed without proper validation. The code strips the surrounding brackets [], splits the string by commas, and then passes each resulting element directly into the selectRaw() function of the query builder.

// User input from 'display' is taken without sanitization.
$select = !empty($request['display']) ? explode(',', substr((string) $request['display'], 1, -1)) : null;

// ...

// The unsanitized input is passed directly to `selectRaw()`.
foreach ($select as $s) {
    $query->selectRaw($s);
}

Since selectRaw() is designed to execute raw SQL expressions, it executes any malicious SQL code provided in the display parameter.

PoC

  1. Log in to an OpenSTAManager instance as any user.
  2. Navigate to the user's profile page to obtain their personal API Token.
  3. Use this API token to send a specially crafted GET request to the API endpoint.

Time-Based Blind Injection Test:

Replace <your_host>, <your_token>, and <resource_name> with your actual values. anagrafiche is a valid resource.

curl "http://<your_host>/openstamanager/api?token=<your_token>&resource=anagrafiche&display=[1,SLEEP(5)]"

The server will delay its response by approximately 5 seconds, confirming the SLEEP(5) command was executed by the database.

Impact

This is a critical SQL Injection vulnerability. Any authenticated user, even those with the lowest privileges, can exploit this vulnerability to:

  • Exfiltrate all data from the database (e.g., user credentials, customer information, invoices, internal data).
  • Modify or delete data, compromising data integrity.
  • Potentially achieve further system compromise, depending on the database user's privileges and system configuration.
Database specific
{
    "nvd_published_at": "2025-11-19T20:15:54Z",
    "github_reviewed": true,
    "cwe_ids": [
        "CWE-89"
    ],
    "severity": "HIGH",
    "github_reviewed_at": "2025-11-19T21:00:37Z"
}
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
Fixed
2.9.5

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

Database specific

last_known_affected_version_range

"<= 2.9.4"