In the core update functionality of baserCMS, some parameters sent from the admin panel are passed to the exec() function without proper validation or escaping. This issue allows an authenticated CMS administrator to execute arbitrary OS commands on the server (Remote Code Execution, RCE).
This vulnerability is not a UI-level issue such as screen manipulation or lack of CSRF protection, but rather stems from a design that directly executes input values received on the server side as OS commands. Therefore, even if buttons are hidden in the UI, or even if CakePHP's CSRF/FormProtection (SecurityComponent) ensures that only legitimate POST requests are accepted, an attack is possible as long as a request containing a valid token is processed within an administrator session.
| Item | Details | | ---- | ------- | | CWE | CWE-78: Improper Neutralization of Special Elements used in an OS Command | | Impact | Remote Code Execution (RCE) | | Severity | Critical | | Attack Requirements | Administrator privileges required | | Reproducibility | Reproducible (confirmed multiple times) | | Test Environment | baserCMS 5.2.2 (Docker / development environment) |
PluginsController::get_core_update()PluginsService::getCoreUpdate()/baser/admin/baser-core/plugins/get_core_updatePluginsController::get_core_update()
↓ Retrieves php parameter from POST data
PluginsService::getCoreUpdate($targetVersion, $php, $force)
↓ Concatenates $php into command string without validation or escaping
exec($command)
PluginsController.php
$service->getCoreUpdate(
$request->getData('targetVersion') ?? '',
$request->getData('php') ?? 'php',
$request->getData('force'),
);
PluginsService.php
$command = $php . ' ' . ROOT . DS . 'bin' . DS . 'cake.php composer ' .
$targetVersion . ' --php ' . $php . ' --dir ' . TMP . 'update';
exec($command, $out, $code);
The $php parameter is user input, and none of the following countermeasures are in place:
escapeshellarg() or similarphp parameterexec() is executed on the server side, running the arbitrary OS commandphp=php;id>/tmp/rce_test;#
$ docker exec bc-php cat /tmp/rce_test
uid=1000(www-data) gid=1000(www-data) groups=1000(www-data)
The above confirms that OS commands can be executed with www-data privileges.
If this vulnerability is exploited, the following becomes possible:
Although administrator privileges are required, this is a design issue where the impact extends from the application layer to the OS layer, and the impact is considered significant.
PHP_BINARY constant$php = escapeshellarg(PHP_BINARY);
escapeshellarg() escaping to other command-line arguments (version number, directory, etc.) as wellescapeshellarg()However, from the perspective of reducing the attack surface, a design that eliminates user input entirely is recommended.
Due to a design issue in baserCMS's core update functionality where user input is passed to exec() without validation, Remote Code Execution (RCE) is achievable with administrator privileges. This vulnerability can be fixed through input validation and design review, and prompt remediation is recommended.
This advisory was translated from Japanese to English using GitHub Copilot.
{
"nvd_published_at": "2026-03-31T01:16:35Z",
"severity": "CRITICAL",
"github_reviewed": true,
"cwe_ids": [
"CWE-78"
],
"github_reviewed_at": "2026-03-31T22:27:05Z"
}