Skip to content

Commit

Permalink
Fix for a security vulnerability with the Error Log module
Browse files Browse the repository at this point in the history
This patch prevents an XSS attack, where an attacker with hacking tools could enter
<script> tags and JavaScript code as their referer URL and then navigate to a page on
your site that did not exist, and their JavaScript code would be executed when an
admin next visited the error log page in Organizer.

This commit also includes some various other miscellaneous fixes.
  • Loading branch information
Chris-Turnbull committed Apr 25, 2020
1 parent 7cb3eb5 commit dfd0afa
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion zenario/admin/db_updates/latest_revision_no.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
define('ZENARIO_MAJOR_VERSION', '8');
define('ZENARIO_MINOR_VERSION', '5');
define('ZENARIO_IS_BUILD', true);
define('ZENARIO_REVISION', '50977');
define('ZENARIO_REVISION', '51340');

define('TINYMCE_DIR', 'zenario/libs/manually_maintained/lgpl/tinymce_4_7_3/');
4 changes: 3 additions & 1 deletion zenario/autoload/welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -2620,7 +2620,9 @@ public static function diagnosticsAJAX(&$source, &$tags, &$fields, &$values, $ch
}
} else {
$fields['0/htaccess_unavailable']['row_class'] = 'warning';
$fields['0/htaccess_unavailable']['snippet']['html'] = \ze\admin::phrase('The .htaccess file cannot be read or is missing. (This message needs revising.)');
$fields['0/htaccess_unavailable']['snippet']['html'] = \ze\admin::phrase('The .htaccess file cannot be read or is missing.');

$fields['0/friendly_urls_disabled']['hidden'] = true;
}

//Check to see if there are spare domains without a primary domain
Expand Down
12 changes: 6 additions & 6 deletions zenario/js/admin_organizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4723,10 +4723,10 @@ zenarioO.columnValue = function(i, c, dontHTMLEscape) {
href = ' style="cursor: default;"';

if (item_link == 'menu_item') {
href += ' title="' + htmlspecialchars(item.name) + '|"';
href += ' title="' + htmlspecialchars(htmlspecialchars(item.name)) + '|"';

} else if (item_link == 'content_item' || item_link == 'content_item_or_url') {
href += ' title="' + htmlspecialchars(item.name) + '|"';
href += ' title="' + htmlspecialchars(htmlspecialchars(item.name)) + '|"';
}

} else {
Expand Down Expand Up @@ -4774,22 +4774,22 @@ zenarioO.columnValue = function(i, c, dontHTMLEscape) {

if (isSKLink) {
if (item_link == 'menu_item') {
href += ' title="' + htmlspecialchars(item.name) + '|' + phrase.clkToViewLinkedMenuNode + '"';
href += ' title="' + htmlspecialchars(htmlspecialchars(item.name)) + '|' + phrase.clkToViewLinkedMenuNode + '"';

} else if (item_link == 'content_item' || item_link == 'content_item_or_url') {
href += ' title="' + htmlspecialchars(item.name) + '|' + phrase.clkToViewLinkedCItem + '"';
href += ' title="' + htmlspecialchars(htmlspecialchars(item.name)) + '|' + phrase.clkToViewLinkedCItem + '"';
}

} else if (isURL) {
href += ' title="' + htmlspecialchars(item.name) + '|' + phrase.clkToViewLinkInNewWindow + '"';
href += ' title="' + htmlspecialchars(htmlspecialchars(item.name)) + '|' + phrase.clkToViewLinkInNewWindow + '"';
}
}


switch (item_link) {
case 'content_item':
case 'content_item_or_url':
itemName = item.name;
itemName = htmlspecialchars(item.name);
break;

case 'menu_item':
Expand Down
20 changes: 10 additions & 10 deletions zenario/js/admin_organizer.min.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion zenario/modules/zenario_forum/module_code.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,9 @@ protected function manageUploads($postId){
$filesToUpload = &$_FILES['filesToUpload'];
$files_count = count($filesToUpload['name']);
for($i=0; $i < $files_count; ++$i){
$this->manageOneUpload($postId, $filesToUpload['tmp_name'][$i], $filesToUpload['name'][$i]);
if (empty($filesToUpload['error'][$i])) {
$this->manageOneUpload($postId, $filesToUpload['tmp_name'][$i], $filesToUpload['name'][$i]);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions zenario/styles/admin_organizer.css
Original file line number Diff line number Diff line change
Expand Up @@ -2358,6 +2358,8 @@ div.organizer_pageSize {
left:0;
margin: 0px auto;
padding:0 0 5px;
max-height:70vh;
overflow-y:auto;
}

#organizer_quickFilter ul ul li {
Expand Down
7 changes: 4 additions & 3 deletions zenario/styles/admin_organizer.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dfd0afa

Please sign in to comment.