Kritisch

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

  • Veröffentlicht: 31.03.2026
  • Aktualisiert: 11.10.2026 10:22

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

php
$service->getCoreUpdate(
    $request->getData('targetVersion') ?? '',
    $request->getData('php') ?? 'php',
    $request->getData('force'),
);

PluginsService.php

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

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

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Composer-Paket baserproject/basercms < 5.2.3 5.2.3

Verweise

CVSS-Wert 9.1/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
Schwäche (CWE)
CWE-78
Plattform
Composer
Paket
baserproject/basercms
Veröffentlicht
31.03.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-qxmc-6f24-g86g - CC BY 4.0

Schwachstellenhistorie: baserproject/basercms

Alle veröffentlichten Schwachstellen dieses Pakets (Composer-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (56) im Archiv
Einträge insgesamt
56
Erste → letzte
08.2020 03.2026
Ohne Fix
7
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 7
  • Hoch 15
  • Mittel 29
  • Niedrig 5

Veröffentlichungen pro Jahr

  1. 2020: 6
  2. 2021: 6
  3. 2022: 21
  4. 2023: 7
  5. 2024: 7
  6. 2025: 0
  7. 2026: 9
Schweregrad:
  1. Hoch · 7.1 CVE-2026-32734 < 5.2.3 5.2.3
  2. Kritisch CVE-2026-30880 < 5.2.3 5.2.3
  3. Kritisch · 9.1 CVE-2026-30877 < 5.2.3 5.2.3
  4. baserCMS has OS Command Injection Leading to Remote Code Execution (RCE) dieser Eintrag
    Kritisch · 9.1 CVE-2026-21861 < 5.2.3 5.2.3
  5. Kritisch · 9.8 CVE-2023-25655 < 4.7.5 4.7.5
  6. Kritisch · 9.8 CVE-2023-25654 < 4.7.5 4.7.5
  7. Hoch · 8.8 CVE-2016-4881 < 3.0.11 3.0.11
  8. Hoch · 8.8 CVE-2016-4878 < 3.0.11 3.0.11
  9. Hoch · 8.8 CVE-2018-0569 >= 4.0.0, <= 4.1.0.1, <= 3.0.15 keine Korrektur
  10. Kritisch · 9.8 CVE-2017-10842 < 3.0.15, >= 4.0.0, < 4.0.6 3.0.15, 4.0.6
  11. Hoch · 8.8 CVE-2017-10844 <= 3.0.14, >= 4.0.0, <= 4.0.5 keine Korrektur
  12. Hoch · 8.1 CVE-2018-0572 >= 4.0.0, < 4.1.1, < 3.0.16 4.1.1, 3.0.16
  13. Hoch · 7.5 CVE-2017-10843 < 3.0.15, >= 4.0.0, < 4.0.6 3.0.15, 4.0.6
  14. Hoch · 8.8 CVE-2016-4879 <= 3.0.10 keine Korrektur
  15. Hoch · 7.2 CVE-2018-18942 < 4.1.4 4.1.4
  16. Hoch · 7.7 CVE-2021-41279 < 4.5.4 4.5.4
  17. Hoch · 8.7 CVE-2021-39136 < 4.5.1 4.5.1
  18. Hoch · 7.2 CVE-2021-20682 < 4.4.5 4.4.5

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.