Skip to content

Commit 620332a

Browse files
jaapmarcuss0t
andauthored
Fix multiple issues (hestiacp#1899)
* Update top_js.html Fix: "Warning: The type attribute for the script element is not needed and should be omitted." * Update end_js.html Fix: "Warning: The type attribute for the script element is not needed and should be omitted." * Update css.html Fix: "Warning: The type attribute for the link element is not needed and should be omitted." * Update main.php Fix php style * Update main.php * Update main.php * Update policies.php * Update policies.php * Update secure_login.php * Update query-3.6.0.min.js * Update top_js.html * Update footer.html * Update header.html * Update header.html * Update index.php Fix php style * Update main.php Fix php style and optimize code * Update index.php Fix php style and optimize code * Update index.php * Update css.html Fix load custom theme * Update hotkeys.html Optimize code, fix error * Update hotkeys.html fix } * Update index.php * Fix XSS issue with list rrd * Fix XSS issue on search page * Fix XSS issue on login page - Remove hidden user field - htmlspecialchars username - Delete old session when generate new session. * XSS issue with $_GET['user'] * Update changelog + improve regenerate session code * Allow static files to be cached Change release branch or enable debug mode to disable the caching * Force redirect user to login * Improve error message Replace "Message" sub.domain.com allready exsists with rv-add-web-domain idn lalal.xxx.nu Error: xxx.nu belongs to a different user * Fix issues with login screen * Update changelog Co-authored-by: s0t <s0t@users.noreply.github.com>
1 parent 8c5bc4c commit 620332a

File tree

22 files changed

+427
-843
lines changed

22 files changed

+427
-843
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ All notable changes to this project will be documented in this file.
2020
- Increased minimal memory requirements for ClamD / ClamAV. #1840
2121
- Restore of backup did not rebuild the "Forced SSL" and "HSTS" config on new account #1862
2222
- Keep changes made by /install/upgrade/manual/install_awstats_geopip.sh on update HestiaCP (via Discord)
23+
- Refactor/improve PHP and HTML code @s0t (#1860)
24+
- Fixed XSS vulnerability in login page and a few other locations @briansemrau / @numanturle
25+
- Delete old session after after session_regenerate_id() @briansemrau
26+
- Improve error message when domain all ready exists on different account.
2327
- Fixed an issue where phpmyadmin did not update when Postgresql was availble.
2428

2529
## [1.4.2] - Service release

func/domain.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,10 +924,18 @@ is_base_domain_owner(){
924924
parse_object_kv_list "$web"
925925
if [ -z "$ALLOW_USERS" ] || [ "$ALLOW_USERS" != "yes" ]; then
926926
# Don't care if $basedomain all ready exists only if the owner is of the base domain is the current user
927-
is_domain_new "" $basedomain
927+
test=$(is_domain_new "" $basedomain)
928+
if [ $? -ne 0 ]; then
929+
echo "Error: $basedomain belongs to a different user";
930+
exit 1;
931+
fi
928932
fi
929933
else
930-
is_domain_new "" $basedomain
934+
test=$(is_domain_new "" $basedomain);
935+
if [ $? -ne 0 ]; then
936+
echo "Error: $basedomain belongs to a different user";
937+
exit 1;
938+
fi
931939
fi
932940
fi
933941
fi

web/delete/web/index.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@
33
error_reporting(NULL);
44
ob_start();
55
session_start();
6-
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
6+
include($_SERVER['DOCUMENT_ROOT'] . '/inc/main.php');
77

88
// Check token
99
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
1010
header('location: /login/');
11-
exit();
11+
exit;
1212
}
1313

1414
// Delete as someone else?
1515
if (($_SESSION['userContext'] === 'admin') && (!empty($_GET['user']))) {
16-
$user=$_GET['user'];
16+
$user = $_GET['user'];
1717
}
1818

1919
if (!empty($_GET['domain'])) {
2020
$v_username = escapeshellarg($user);
2121
$v_domain = escapeshellarg($_GET['domain']);
22-
exec (HESTIA_CMD."v-delete-web-domain ".$v_username." ".$v_domain." 'yes'", $output, $return_var);
23-
check_return_code($return_var,$output);
22+
exec (HESTIA_CMD . 'v-delete-web-domain ' . $v_username . ' ' . $v_domain . " 'yes'", $output, $return_var);
23+
check_return_code($return_var, $output);
2424
unset($output);
2525
}
2626

2727
$back = $_SESSION['back'];
2828
if (!empty($back)) {
29-
header("Location: ".$back);
29+
header('Location: ' . $back);
3030
exit;
3131
}
3232

33-
header("Location: /list/web/");
33+
header('Location: /list/web/');
3434
exit;

0 commit comments

Comments
 (0)