Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐘 Packagist

GHSA-qxmc-6f24-g86g

CRITICAL

baserCMS has OS Command Injection Leading to Remote Code Execution (RCE)

Also known asCVE-2026-21861
Published
Mar 31, 2026
Updated
Mar 31, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed

EPSS Exploitation Probability

via FIRST.org ↗
2.3%probability of exploitation in next 30 days
Lower Risk81th percentile+2.15%
0.00%0.98%1.95%2.93%0.2%0.4%0.1%2.3%Apr 26Jun 26Jun 26

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

Blast Radius

1 pkg affected
🐘baserproject/basercms

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.

Description

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

ItemDetails
CWECWE-78: Improper Neutralization of Special Elements used in an OS Command
ImpactRemote Code Execution (RCE)
SeverityCritical
Attack RequirementsAdministrator privileges required
ReproducibilityReproducible (confirmed multiple times)
Test EnvironmentbaserCMS 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.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐘Packagistbaserproject/basercmsall versions5.2.3

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for baserproject/basercms. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update baserproject/basercms to 5.2.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-qxmc-6f24-g86g is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-qxmc-6f24-g86g is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-qxmc-6f24-g86g. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

## 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/F
O3 Security · Impact-Aware SCA

Is GHSA-qxmc-6f24-g86g in your dependencies?

O3 detects GHSA-qxmc-6f24-g86g across Packagist dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

GHSA-qxmc-6f24-g86g: baserproject/basercms Remote Code Executio… | O3 Security