GHSA-q4rm-m6xh-5pv7: Froxlor/froxlor Froxlor Customer Can Create MySQL Vulnerability

MODERATE
CVSS 4.3
CWE-285
Published
Advisory Summary

GHSA-q4rm-m6xh-5pv7 is a MODERATE (CVSS 4.3) froxlor customer can create mysql vulnerability (CWE-285: Improper Authorization) affecting Froxlor/froxlor libraries in the Packagist ecosystem. The issue involves froxlor customer can create mysql databases on disallowed servers via mysqls.add api. Remediation is available by upgrading affected packages to version 2.3.7.

GHSA-q4rm-m6xh-5pv7 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-q4rm-m6xh-5pv7
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-285: Improper Authorization
Affected Product Froxlor/froxlor
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 4.3

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:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-q4rm-m6xh-5pv7

To remediate this vulnerability, upgrade all affected Froxlor/froxlor dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

froxlor/froxlor fixed: 2.3.7
Upgrade froxlor/froxlor to 2.3.7
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 froxlor/froxlor

How to Check if You Are Affected

To determine whether your application is affected by GHSA-q4rm-m6xh-5pv7, inspect your project dependencies for Froxlor/froxlor:

inspect dependencies for froxlor/froxlor

Analyze the terminal output to locate any version of Froxlor/froxlor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.7), 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-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Froxlor/froxlor, 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 The `Mysqls.add` API command (`lib/Froxlor/Api/Commands/Mysqls.php`) accepts a customer-controlled `mysql_server` parameter and only validates that the value is numeric and that the server index exists in `userdata.inc.php`. It never checks the value against the calling customer's `allowed_mysqlserver` allowlist. A customer can therefore create a database, plus a MySQL user with a password they choose, on any MySQL server the operator has configured — including servers that were explicitly excluded from that customer (e.g. a separate cluster, premium-tier host, or another tenant pool). The same `allowed_mysqlserver` check is correctly enforced in `MysqlServer::get()` / `MysqlServer::listing()` and in the customer-facing UI (`customer_mysql.php`), confirming the omission is a bug, not by-design. ## Details **Vulnerable code path** — `lib/Froxlor/Api/Commands/Mysqls.php:69-99` (`add()`): ```php public function add() { if (($this->getUserDetail('mysqls_used') < $this->getUserDetail('mysqls') || ...) { ... $customer = $this->getCustomerData('mysqls'); // line 80 $dbserver = $this->getParam('mysql_server', true, // line 81 — user-controlled $this->getDefaultMySqlServer($customer)); ... $dbserver = Validate::validate($dbserver, ..., '/^[0-9]+$/', ...); // line 92 — numeric only Database::needRoot(true, $dbserver, false); // line 93 — root ctx for ANY index Database::needSqlData(); $sql_root = Database::getSqlData(); Database::needRoot(false); if (!is_array($sql_root)) { // line 97 — only existence check throw new Exception("Database server with index #" . $dbserver . " is unknown", 404); } ... $username = $dbm->createDatabase($newdb_params['loginname'], $password, $dbserver, ...); // line 116/118 — DB+user created ... Database::pexecute($stmt, ["customerid"=>$customer['customerid'], ..., "dbserver"=>$dbserver], ...); } } ``` The `$customer['allowed_mysqlserver']` field IS read on line 80 but is only consumed by `getDefaultMySqlServer()` (lines 566-573) to compute a default when the request omits `mysql_server`. As soon as the client supplies the parameter, the default path is skipped and no further authorization gate runs. **Cross-file evidence the check is intended elsewhere:** - `lib/Froxlor/Api/Commands/MysqlServer.php:319-323` — `get()` rejects with HTTP 405 when `$dbserver` is not in `allowed_mysqlserver`: ```php if ($this->isAdmin() == false) { $allowed_mysqls = json_decode($this->getUserDetail('allowed_mysqlserver'), true); if ($allowed_mysqls === false || empty($allowed_mysqls) || !in_array($dbserver, $allowed_mysqls)) { throw new Exception("You cannot access this resource", 405); } ... } ``` - `lib/Froxlor/Api/Commands/MysqlServer.php:252-257` — same allowlist filter on `listing()`. - `customer_mysql.php:222` — UI rejects with `Response::dynamicError('No permission')` when `empty($allowed_mysqlservers)`. **Chain of execution (attacker → impact):** 1. Customer authenticates to `api.php` with apikey/secret. The only API gate is `cust_api_allowed`; `allowed_mysqlserver` is not consulted at auth time. 2. Customer sends JSON `{"command":"Mysqls.add","params":{"mysql_password":"<valid>","mysql_server":<disallowed_idx>}}`. 3. `Mysqls.php:71` quota check passes (`mysqls_used < mysqls`). 4. `Mysqls.php:80` `getCustomerData('mysqls')` returns the caller's own row. 5. `Mysqls.php:81` `$dbserver` is set from the request (default-fallback path skipped). 6. `Mysqls.php:92` numeric regex passes. 7. `Mysqls.php:93-99` `Database::needRoot(true, $dbserver, false)` switches to the root context of the attacker-chosen server; existence check passes. 8. `Mysqls.php:116/118` `DbManager::createDatabase(...)` runs against the disallowed server using stored root credentials, creating the DB and granting the supplied password to `<loginname>_<sqlN>` (DbManager.php:177-218). 9. `Mysqls.php:127-141` inserts a row into `TABLE_PANEL_DATABASES` with the attacker's `customerid` and the disallowed `dbserver`, allowing later management via `Mysqls.get/update/delete` (which only filter by `customerid` for non-admins, e.g. `Mysqls.php:282`). ## PoC Preconditions on the target instance: - ≥2 MySQL servers configured in `lib/userdata.inc.php` (e.g. index 0 default, index 1 internal/premium). - Customer X with `allowed_mysqlserver=[0]`, `cust_api_allowed=1`, `mysqls > 0`, and an issued API key (`apikey:secret`). Request — customer creates a database on server `1`, which is *not* in their allowlist: ```bash curl -k -u 'CUST_APIKEY:CUST_SECRET' \ -H 'Content-Type: application/json' \ -X POST \ -d '{"command":"Mysqls.add","params":{"mysql_password":"ValidP@ssw0rd!","mysql_server":1}}' \ https://froxlor.example.com/api.php ``` Expected (mirroring `MysqlServer.get()` behaviour): `HTTP 405 — "You cannot access this resource"`. Actual: `HTTP 200` with the full database record, e.g.: ```json {"data":{"id":42,"customerid":<cust_id>,"databasename":"<loginname>_sql1","dbserver":1,...}} ``` Verify the credentials work on the forbidden server: ```bash mysql -h server1.host -u <loginname>_sql1 -p # password: ValidP@ssw0rd! mysql> SHOW DATABASES; # the new DB is present mysql> USE <loginname>_sql1; # full access to the newly-created DB ``` The customer can subsequently manage the DB via `Mysqls.get`, `Mysqls.update`, and `Mysqls.delete` — those non-admin code paths filter only by `customerid` (`Mysqls.php:282-289`, `Mysqls.php:380-391`), which matches. ## Impact - Bypass of the per-customer MySQL-server allowlist (`allowed_mysqlserver`) enforced by the admin/reseller. The authorization model is fully defeated for the `add` operation. - The customer obtains valid MySQL credentials on a server the operator explicitly excluded for them — possibly an internal/separate cluster, billing tier, premium-only host, or a server provisioned for a different tenant pool. - The customer can persist a DB on the forbidden server (resource and policy bypass), then read/write data there, and continue to manage it through `Mysqls.update` / `Mysqls.delete`. - Impact is bounded: privileges granted by `DbManager::grantPrivilegesTo` apply only to the new `<loginname>_sqlN` database, so no cross-tenant data exposure on the forbidden server. The damage is policy bypass, resource consumption on the forbidden server, and credential persistence there. ## Recommended Fix Mirror the allowlist check already present in `MysqlServer::get()`. After the numeric validation on `Mysqls.php:92`, before `Database::needRoot(...)`, add for non-admin callers: ```php // validate whether the dbserver exists $dbserver = Validate::validate($dbserver, html_entity_decode(lng('mysql.mysql_server')), '/^[0-9]+$/', '', 0, true); // enforce per-customer allowed_mysqlserver allowlist (parity with MysqlServer::get()) if (!$this->isAdmin()) { $allowed = json_decode($customer['allowed_mysqlserver'] ?? '[]', true); if (!is_array($allowed) || empty($allowed) || !in_array((int)$dbserver, array_map('intval', $allowed), true)) { throw new Exception('You cannot access this resource', 405); } } Database::needRoot(true, $dbserver, false); ``` Audit `Mysqls::update()`, `Mysqls::delete()`, and `Mysqls::get()` for the same gap: those endpoints accept `mysql_server` and ultimately call `Database::needRoot(true, $result['dbserver'], false)` on the row's stored value. Once the row exists with a forbidden `dbserver`, those paths execute against the forbidden server unchallenged. Consider rejecting any non-admin operation whose target row's `dbserver` is outside `allowed_mysqlserver`, even if the row already exists, to defend in depth.

GHSA-q4rm-m6xh-5pv7 Affected Froxlor/froxlor Versions

1 component(s)
Fixed Versions:
2.3.7
Product / Package Ecosystem Affected Versions Fixed Version
froxlor/froxlor
Packagist
< 2.3.7
2.3.7

References

Frequently Asked Questions

What is GHSA-q4rm-m6xh-5pv7?
GHSA-q4rm-m6xh-5pv7 is a security vulnerability in Froxlor/froxlor involving Froxlor customer can create MySQL databases on disallowed servers via Mysqls.add API under CWE-285: Improper Authorization.
Which Froxlor/froxlor versions are affected?
Affected versions include releases prior to 2.3.7 across affected packages: froxlor/froxlor.
What version fixes GHSA-q4rm-m6xh-5pv7?
Upgrading to 2.3.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is froxlor/froxlor affected?
Yes, froxlor/froxlor is affected in releases prior to 2.3.7. Upgrade your dependency to 2.3.7 or later.
What is the CVSS score of GHSA-q4rm-m6xh-5pv7?
GHSA-q4rm-m6xh-5pv7 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with GHSA-q4rm-m6xh-5pv7?
GHSA-q4rm-m6xh-5pv7 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Packagist dependencies for GHSA-q4rm-m6xh-5pv7?
Run the dependency tree command: 'inspect dependencies for froxlor/froxlor'. 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-q4rm-m6xh-5pv7",
  "modified" : "2026-07-02T19:23:49Z",
  "published" : "2026-07-02T19:23:49Z",
  "aliases" : [ ],
  "summary" : "Froxlor customer can create MySQL databases on disallowed servers via Mysqls.add API",
  "details" : "## Summary\n\nThe `Mysqls.add` API command (`lib/Froxlor/Api/Commands/Mysqls.php`) accepts a customer-controlled `mysql_server` parameter and only validates that the value is numeric and that the server index exists in `userdata.inc.php`. It never checks the value against the calling customer's `allowed_mysqlserver` allowlist. A customer can therefore create a database, plus a MySQL user with a password they choose, on any MySQL server the operator has configured — including servers that were explicitly excluded from that customer (e.g. a separate cluster, premium-tier host, or another tenant pool). The same `allowed_mysqlserver` check is correctly enforced in `MysqlServer::get()` / `MysqlServer::listing()` and in the customer-facing UI (`customer_mysql.php`), confirming the omission is a bug, not by-design.\n\n## Details\n\n**Vulnerable code path** — `lib/Froxlor/Api/Commands/Mysqls.php:69-99` (`add()`):\n\n```php\npublic function add()\n{\n    if (($this->getUserDetail('mysqls_used') < $this->getUserDetail('mysqls') || ...) {\n        ...\n        $customer = $this->getCustomerData('mysqls');                       // line 80\n        $dbserver = $this->getParam('mysql_server', true,                    // line 81 — user-controlled\n            $this->getDefaultMySqlServer($customer));\n        ...\n        $dbserver = Validate::validate($dbserver, ..., '/^[0-9]+$/', ...);   // line 92 — numeric only\n        Database::needRoot(true, $dbserver, false);                          // line 93 — root ctx for ANY index\n        Database::needSqlData();\n        $sql_root = Database::getSqlData();\n        Database::needRoot(false);\n        if (!is_array($sql_root)) {                                          // line 97 — only existence check\n            throw new Exception(\"Database server with index #\" . $dbserver . \" is unknown\", 404);\n        }\n        ...\n        $username = $dbm->createDatabase($newdb_params['loginname'], $password,\n            $dbserver, ...);                                                 // line 116/118 — DB+user created\n        ...\n        Database::pexecute($stmt, [\"customerid\"=>$customer['customerid'], ..., \"dbserver\"=>$dbserver], ...);\n    }\n}\n```\n\nThe `$customer['allowed_mysqlserver']` field IS read on line 80 but is only consumed by `getDefaultMySqlServer()` (lines 566-573) to compute a default when the request omits `mysql_server`. As soon as the client supplies the parameter, the default path is skipped and no further authorization gate runs.\n\n**Cross-file evidence the check is intended elsewhere:**\n\n- `lib/Froxlor/Api/Commands/MysqlServer.php:319-323` — `get()` rejects with HTTP 405 when `$dbserver` is not in `allowed_mysqlserver`:\n  ```php\n  if ($this->isAdmin() == false) {\n      $allowed_mysqls = json_decode($this->getUserDetail('allowed_mysqlserver'), true);\n      if ($allowed_mysqls === false || empty($allowed_mysqls) || !in_array($dbserver, $allowed_mysqls)) {\n          throw new Exception(\"You cannot access this resource\", 405);\n      }\n      ...\n  }\n  ```\n- `lib/Froxlor/Api/Commands/MysqlServer.php:252-257` — same allowlist filter on `listing()`.\n- `customer_mysql.php:222` — UI rejects with `Response::dynamicError('No permission')` when `empty($allowed_mysqlservers)`.\n\n**Chain of execution (attacker → impact):**\n\n1. Customer authenticates to `api.php` with apikey/secret. The only API gate is `cust_api_allowed`; `allowed_mysqlserver` is not consulted at auth time.\n2. Customer sends JSON `{\"command\":\"Mysqls.add\",\"params\":{\"mysql_password\":\"<valid>\",\"mysql_server\":<disallowed_idx>}}`.\n3. `Mysqls.php:71` quota check passes (`mysqls_used < mysqls`).\n4. `Mysqls.php:80` `getCustomerData('mysqls')` returns the caller's own row.\n5. `Mysqls.php:81` `$dbserver` is set from the request (default-fallback path skipped).\n6. `Mysqls.php:92` numeric regex passes.\n7. `Mysqls.php:93-99` `Database::needRoot(true, $dbserver, false)` switches to the root context of the attacker-chosen server; existence check passes.\n8. `Mysqls.php:116/118` `DbManager::createDatabase(...)` runs against the disallowed server using stored root credentials, creating the DB and granting the supplied password to `<loginname>_<sqlN>` (DbManager.php:177-218).\n9. `Mysqls.php:127-141` inserts a row into `TABLE_PANEL_DATABASES` with the attacker's `customerid` and the disallowed `dbserver`, allowing later management via `Mysqls.get/update/delete` (which only filter by `customerid` for non-admins, e.g. `Mysqls.php:282`).\n\n## PoC\n\nPreconditions on the target instance:\n- ≥2 MySQL servers configured in `lib/userdata.inc.php` (e.g. index 0 default, index 1 internal/premium).\n- Customer X with `allowed_mysqlserver=[0]`, `cust_api_allowed=1`, `mysqls > 0`, and an issued API key (`apikey:secret`).\n\nRequest — customer creates a database on server `1`, which is *not* in their allowlist:\n\n```bash\ncurl -k -u 'CUST_APIKEY:CUST_SECRET' \\\n  -H 'Content-Type: application/json' \\\n  -X POST \\\n  -d '{\"command\":\"Mysqls.add\",\"params\":{\"mysql_password\":\"ValidP@ssw0rd!\",\"mysql_server\":1}}' \\\n  https://froxlor.example.com/api.php\n```\n\nExpected (mirroring `MysqlServer.get()` behaviour): `HTTP 405 — \"You cannot access this resource\"`.\nActual: `HTTP 200` with the full database record, e.g.:\n\n```json\n{\"data\":{\"id\":42,\"customerid\":<cust_id>,\"databasename\":\"<loginname>_sql1\",\"dbserver\":1,...}}\n```\n\nVerify the credentials work on the forbidden server:\n\n```bash\nmysql -h server1.host -u <loginname>_sql1 -p   # password: ValidP@ssw0rd!\nmysql> SHOW DATABASES;        # the new DB is present\nmysql> USE <loginname>_sql1;  # full access to the newly-created DB\n```\n\nThe customer can subsequently manage the DB via `Mysqls.get`, `Mysqls.update`, and `Mysqls.delete` — those non-admin code paths filter only by `customerid` (`Mysqls.php:282-289`, `Mysqls.php:380-391`), which matches.\n\n## Impact\n\n- Bypass of the per-customer MySQL-server allowlist (`allowed_mysqlserver`) enforced by the admin/reseller. The authorization model is fully defeated for the `add` operation.\n- The customer obtains valid MySQL credentials on a server the operator explicitly excluded for them — possibly an internal/separate cluster, billing tier, premium-only host, or a server provisioned for a different tenant pool.\n- The customer can persist a DB on the forbidden server (resource and policy bypass), then read/write data there, and continue to manage it through `Mysqls.update` / `Mysqls.delete`.\n- Impact is bounded: privileges granted by `DbManager::grantPrivilegesTo` apply only to the new `<loginname>_sqlN` database, so no cross-tenant data exposure on the forbidden server. The damage is policy bypass, resource consumption on the forbidden server, and credential persistence there.\n\n## Recommended Fix\n\nMirror the allowlist check already present in `MysqlServer::get()`. After the numeric validation on `Mysqls.php:92`, before `Database::needRoot(...)`, add for non-admin callers:\n\n```php\n// validate whether the dbserver exists\n$dbserver = Validate::validate($dbserver, html_entity_decode(lng('mysql.mysql_server')), '/^[0-9]+$/', '', 0, true);\n\n// enforce per-customer allowed_mysqlserver allowlist (parity with MysqlServer::get())\nif (!$this->isAdmin()) {\n    $allowed = json_decode($customer['allowed_mysqlserver'] ?? '[]', true);\n    if (!is_array($allowed) || empty($allowed)\n        || !in_array((int)$dbserver, array_map('intval', $allowed), true)) {\n        throw new Exception('You cannot access this resource', 405);\n    }\n}\n\nDatabase::needRoot(true, $dbserver, false);\n```\n\nAudit `Mysqls::update()`, `Mysqls::delete()`, and `Mysqls::get()` for the same gap: those endpoints accept `mysql_server` and ultimately call `Database::needRoot(true, $result['dbserver'], false)` on the row's stored value. Once the row exists with a forbidden `dbserver`, those paths execute against the forbidden server unchallenged. Consider rejecting any non-admin operation whose target row's `dbserver` is outside `allowed_mysqlserver`, even if the row already exists, to defend in depth.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "froxlor/froxlor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.7"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.3.6"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/froxlor/froxlor/security/advisories/GHSA-q4rm-m6xh-5pv7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/froxlor/froxlor"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-02T19:23:49Z",
    "nvd_published_at" : null
  }
}