GHSA-qxmc-6f24-g86g

Suggest an improvement
Source
https://github.com/advisories/GHSA-qxmc-6f24-g86g
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-qxmc-6f24-g86g/GHSA-qxmc-6f24-g86g.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-qxmc-6f24-g86g
Aliases
Published
2026-03-31T22:27:05Z
Modified
2026-03-31T22:33:32.868167Z
Severity
  • 9.1 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H CVSS Calculator
Summary
baserCMS has OS Command Injection Leading to Remote Code Execution (RCE)
Details

Summary

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.


Vulnerability Information

| 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) |


Affected Areas

  • Controller
    • PluginsController::get_core_update()
  • Service
    • PluginsService::getCoreUpdate()
  • Affected Endpoint
    • /baser/admin/baser-core/plugins/get_core_update

Technical Details

Vulnerable Code Flow

PluginsController::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)

Relevant Code (Excerpt)

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:

  • Restriction via allowlist
  • Validation via regular expression
  • Escaping via escapeshellarg() or similar

Attack Scenario

  1. The attacker logs in as a CMS administrator
  2. Sends a POST request to the core update functionality in the admin panel
  3. Specifies a string containing OS commands in the php parameter
  4. exec() is executed on the server side, running the arbitrary OS command

Example Attack Input (Conceptual)

php=php;id>/tmp/rce_test;#

Verification Results (PoC)

Execution Result

$ 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.

Additional Notes

  • Reproducible through the legitimate flow in the admin panel (browser)
  • Succeeds even with CSRF/FormProtection tokens included in a legitimate request
  • Failure cases (400/403) have also been investigated and differentiated
  • Confirmed reproducible via resending HTTP requests with tools such as curl (resending the same request containing valid tokens)

Impact

If this vulnerability is exploited, the following becomes possible:

  • Retrieval of server information
  • Reading/writing arbitrary files
  • Retrieval of application configuration information (DB credentials, etc.)
  • OS-level operations beyond application permission boundaries

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.


Recommended Fix

Primary Recommendation

  • Do not accept the PHP executable path from user input
  • Fix the PHP executable on the server side using the PHP_BINARY constant
$php = escapeshellarg(PHP_BINARY);

Supplementary Fix Recommendations

  • Apply escapeshellarg() escaping to other command-line arguments (version number, directory, etc.) as well
  • If possible, consider using execution methods that do not involve shell interpretation (array format, Process class, etc.)

Alternative (Not Recommended)

  • Allowlist validation for the PHP executable path
  • Combined use of regex validation and escapeshellarg()

However, from the perspective of reducing the attack surface, a design that eliminates user input entirely is recommended.


Additional Notes

  • This issue is independent of UI display controls (showing/hiding buttons)
  • As long as the endpoint exists, an attack is possible if a request containing valid tokens is processed
  • This is a problem stemming from the design-level handling of input, and cannot be prevented by CSRF or UI controls alone

Conclusion

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.

Database specific
{
    "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"
}
References

Affected packages

Packagist / baserproject/basercms

Package

Name
baserproject/basercms
Purl
pkg:composer/baserproject/basercms

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.2.3

Affected versions

2.*
2.0.0-rc1
2.0.0-rc2
2.0.0-rc3
2.0.0-rc4
2.0.0-rc5
2.0.0-rc6
3.*
3.0.7
3.0.7.1
3.0.8
3.0.8.1
3.0.9
3.0.9.1
3.0.10
3.0.10.1
3.0.11
3.0.11.1
3.0.12
3.0.13
3.0.14
3.0.15
3.0.16
3.0.17
3.0.18
3.0.19
3.0.20
3.0.21
3.0.22
3.0.23
3.0.24
3.0.25
3.0.26
4.*
4.0.0-beta
4.0.0
4.0.1
4.0.2
4.0.2.1
4.0.3
4.0.4
4.0.5
4.0.5.1
4.0.5.2
4.0.6
4.0.7
4.0.8
4.0.9
4.0.10
4.0.10.1
4.0.11
4.1.0
4.1.0.1
4.1.1
4.1.2
4.1.3
4.1.4
4.1.5
4.1.6
4.1.7
4.1.8
4.2.0
4.2.1
4.2.2
4.2.3
4.2.4
4.2.5
4.3.0
4.3.1
4.3.2
4.3.3
4.3.4
4.3.5
4.3.6
4.3.7
4.3.7.1
4.4.0
4.4.1
4.4.1.1
4.4.2
4.4.2.1
4.4.3
4.4.4
4.4.5
4.4.6
4.4.7
4.4.8
4.5.0
4.5.1
4.5.2
4.5.3
4.5.4
4.5.5
4.5.6
4.6.0
4.6.1
4.6.1.1
4.6.2
4.6.3
4.7.0
4.7.2
4.7.3
4.7.5
4.7.6
4.7.7
4.7.8
4.8.0
4.8.1
4.8.2
5.*
5.0.0-beta1
5.0.0-beta2
5.0.0-beta3
5.0.0-beta4
5.0.0
5.0.1
5.0.2
5.0.3
5.0.4
5.0.5
5.0.6
5.0.7
5.0.8
5.0.9
5.0.10
5.0.11
5.0.12
5.0.14
5.0.15
5.0.16
5.0.17
5.0.18
5.0.19
5.0.20
5.0.21
5.1.0
5.1.1
5.1.2
5.1.3
5.1.4
5.1.5
5.1.6
5.1.7
5.1.8
5.1.9
5.1.10
5.2.0
5.2.1
5.2.2

Database specific

last_known_affected_version_range
"<= 5.2.2"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-qxmc-6f24-g86g/GHSA-qxmc-6f24-g86g.json"