From 9f072764d32e813a2af62dae89cd3a1bcd258a41 Mon Sep 17 00:00:00 2001 From: Git Date: Tue, 5 Jan 2016 08:00:28 +0000 Subject: [PATCH] Empty commit --- docs/CHANGES.txt | 3 +++ sections/user/permissions.php | 14 +++++++++++--- sections/wiki/article.php | 6 +++--- sections/wiki/delete.php | 9 +++++++++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 90e8ed8c..69099730 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -1,5 +1,8 @@ CHANGE LOG +2016-01-03 by newman +Fix several permissions bugs + 2015-12-24 by newman Fix several XSS, SQLi, and misc vulnerabilities diff --git a/sections/user/permissions.php b/sections/user/permissions.php index 496e8fd6..3ef27f2f 100644 --- a/sections/user/permissions.php +++ b/sections/user/permissions.php @@ -1,12 +1,20 @@ query("SELECT p.Level + FROM permissions p + JOIN users_main AS um ON um.PermissionID = p.ID + WHERE um.ID = '" . $_REQUEST['userid'] . "'"); +list($UserClass) = $DB->next_record(); + +if (!check_perms('admin_manage_permissions', $UserClass)) { + error(403); +} + include(SERVER_ROOT."/classes/permissions_form.php"); list($UserID, $Username, $PermissionID) = array_values(Users::user_info($_REQUEST['userid'])); diff --git a/sections/wiki/article.php b/sections/wiki/article.php index 0c0dbb8a..8a776e4c 100644 --- a/sections/wiki/article.php +++ b/sections/wiki/article.php @@ -50,9 +50,9 @@ Contribute History - - - Delete + + Delete + diff --git a/sections/wiki/delete.php b/sections/wiki/delete.php index 84ec58af..e5eec119 100644 --- a/sections/wiki/delete.php +++ b/sections/wiki/delete.php @@ -1,4 +1,6 @@ query("SELECT MinClassEdit FROM wiki_articles WHERE ID = '$ID'"); +list($MinEditClass) = $DB->next_record(); + +if ($MinEditClass > $LoggedUser['EffectiveClass']) { + error(403); +} + $DB->query(" SELECT Title FROM wiki_articles