GHSA-hm57-pvxc-4pcm
databasement: Authenticated RCE via the Backup "Database Names" Field
databasement
CVSS
8.8HighExploitationNo known exploitationNot in CISA KEV, which does not prove it is unexploitedCISA KEV
Exploit odds (EPSS)No scoreNo FIRST EPSS score in this snapshot yet
What fixes it
- 1.8.2databasement, composerGitHub
composer require "databasement:^1.8.2"
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
Summary
databasement runs the dump client (mariadb-dump) as a shell command, and a logged-in user controls the database name that goes into it. The database name is validated only as a generic string, so a value such as--result-file=/app/public/index.php is passed to mariadb-dump and interpreted as an option, allowing an arbitrary file write.
Details
app/Http/Requests/Api/V1/SaveDatabaseServerRequest.php(lines 118-119): for MySQL/PostgreSQL/MongoDB,backups.*.database_names.*is validated only asstring|max:255(noSafeDumpFlags/identifier check, unlikedump_flags).app/Services/Backup/Databases/MysqlDatabase.php(lines 101-134):dump()builds a shell command string placing the database name as a bare positional argument.app/Services/Backup/ShellProcessor.php(line 39): executes it viaProcess::fromShellCommandline.- The same positional-database pattern applies to
PostgresqlDatabase.phpand the restore clients.
PoC
Refer to the attached report for step by step along with POC screenshots. Authenticated RCE.pdf
Impact
- Remote code execution as the web-application user, reachable by any authenticated
member. - Disclosure of the application key, allowing decryption of all stored database credentials, SSH private keys, and cloud/storage secrets across every configured server and organization; pivot to those targets; tamper with backups/restores.
- Arbitrary file write to any path the application user can reach is the underlying primitive.
Text from GitHub Advisory Database
Affected versions 1
- databasement, composer>= 1.0.0, < 1.8.2GitHub