Skip to content

Commit

Permalink
Further hardening of Xerte
Browse files Browse the repository at this point in the history
 - Really switch off extract and archive in elfinder
 - Change session id each time authitaction context is changed
  • Loading branch information
torinfo committed Dec 6, 2023
1 parent 54e1bcc commit 6415656
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
7 changes: 0 additions & 7 deletions editor/elfinder/browse.php
Expand Up @@ -164,15 +164,8 @@
// navbarfolder menu
navbar : ['open', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', '|', 'mkdir', '|', 'info'],

// current directory menu
//cwd : ['reload', 'back', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', 'info'],
cwd : ['reload', '|', 'upload', 'mkdir', 'paste', '|', 'info'],

// current directory file menu
//files : [
// 'getfile', '|','open', 'quicklook', '|', 'download', '|', 'copy', 'cut', 'paste', 'duplicate', '|',
// 'rm', '|', 'edit', 'rename', 'resize', '|', 'archive', 'extract', '|', 'info'
//]
files : [
'getfile', '|','quicklook', '|', 'download', '|', 'copy', 'cut', 'paste', 'duplicate', '|',
'rm', '|', 'edit', 'rename', 'resize', '|', 'info'
Expand Down
3 changes: 2 additions & 1 deletion editor/elfinder/php/connector.php
Expand Up @@ -99,9 +99,10 @@ function sanitizeName($cmd, $result, $args, $elfinder)
'tmbURL' => $rooturl . "/media/.tmb",
'tmbCrop' => false,
'uploadDeny' => array('text/x-php','application/x-php'),
'disabled' => array('archive', 'extract', 'forward', 'netmount', 'netunmount', 'zipdl'),
'attributes' => array(
array( // hide readmes
'pattern' => '/(readme\.txt)|\.(html|php|php5|php*|py|pl|sh)$/i',
'pattern' => '/(readme\.txt)|\.(html|php|php5|php*|phtml|phar|py|pl|sh)$/i',
'read' => false,
'write' => false,
'locked' => true,
Expand Down
2 changes: 1 addition & 1 deletion logout.php
Expand Up @@ -43,5 +43,5 @@
_debug("Single Logout");
$authmech->logout();
}

session_regenerate_id(true);
session_destroy();
2 changes: 1 addition & 1 deletion management.php
Expand Up @@ -188,7 +188,7 @@ function mgt_page($xerte_toolkits_site, $extra)
$authmech = Xerte_Authentication_Factory::create($xerte_toolkits_site->authentication_method);
}
if (($_POST["login"] == $xerte_toolkits_site->admin_username) && (hash('sha256', $_POST["password"]) == $xerte_toolkits_site->admin_password)) {

session_regenerate_id(true);
$_SESSION['toolkits_logon_id'] = "site_administrator";

$msg = "Admin user logged in successfully from " . $_SERVER['REMOTE_ADDR'];
Expand Down
5 changes: 5 additions & 0 deletions website_code/php/login_library.php
Expand Up @@ -459,6 +459,9 @@ function login_processing($exit = true) {
if (empty($errors)) {
if ($authmech->check()) {
$success = $authmech->login($_POST['login'], $_POST['password']);
if ($success) {
session_regenerate_id(true);
}
}
$errors = $authmech->getErrors();
}
Expand Down Expand Up @@ -527,3 +530,5 @@ function login_processing2($firstname = false, $surname = false, $username = fal
$msg = "User " . $_SESSION['toolkits_logon_username'] . " logged in successfully from " . $_SERVER['REMOTE_ADDR'];
receive_message($_SESSION['toolkits_logon_username'], "SYSTEM", "LOGINS", "Successful login", $msg);
}


0 comments on commit 6415656

Please sign in to comment.