Skip to content

Commit b178b97

Browse files
authored
Fix security issues in v-add-web-domain-redirect + Sync up main with release (hestiacp#2814)
* Fix v-add-web-domain-redirect * Remove sudo permission admin group on new setups We delete the group before install anyway * Block "sudo" from * Add missing slash * Update changelog * Update versions
1 parent f975eab commit b178b97

File tree

8 files changed

+58
-16
lines changed

8 files changed

+58
-16
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [1.6.6] - Service release
5+
6+
### Bugfixes
7+
8+
- Update DNS templates with CNAME for ftp, www and webmail (#2808)
9+
- Fix name server A record validation error (#2807)
10+
- Fixed issue with renaming domains and config files not properly removed (#2803)
11+
- Add loading indicator after clicking save button (#2740)
12+
- Improve hostname detection in mail-wrapper (#2805 @clarkchentw)
13+
14+
### Security
15+
16+
- Fixed an vulnerability in v-add-web-domain-redirect (CVE-2022-2636)
17+
- Fixed an vulnerability in Ubuntu that can lead in privilege escalation for admin to root user (CVE-2022-2626)
18+
19+
### Dependencies
20+
21+
- Update Roundcube to 1.6.0
22+
- Update Dokuwiki to "2022-07-31" Igor (#2811)
23+
424
## [1.6.5] - Service release
525

626
### Bugfixes
@@ -13,7 +33,7 @@ All notable changes to this project will be documented in this file.
1333
- Improve random bytes generator (#2774)
1434
- Don't allow /inc/2fa/secret.php called from the web browser directly (#2784 @mayappear)
1535
- Improve CSRF Origin Check Bypass (#2785 @mayappear)
16-
- Fix vulnerability in Docuwiki Quick Install App @redstarp2 (CVE 2022-xxx-xxx)
36+
- Fix vulnerability in Docuwiki Quick Install App @redstarp2 (CVE-2022-2550)
1737

1838
### Dependencies
1939

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[Hestia Control Panel](https://www.hestiacp.com/)
44
==================================================
5-
**Latest stable release:** Version 1.6.5 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md) | [![Build Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp) <br>
5+
**Latest stable release:** Version 1.6.6 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md) | [![Build Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp) <br>
66

77
**Web:** [www.hestiacp.com](https://www.hestiacp.com/)<br>
88
**Documentation:** [docs.hestiacp.com](https://docs.hestiacp.com/)<br>

bin/v-add-user

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ source_conf "$HESTIA/conf/hestia.conf"
3131

3232
is_user_free() {
3333
# these names may cause issues with MariaDB/MySQL database names and should be reserved:
34+
# sudo has been added due to Privilege escalation as sudo group has always sudo permission
3435
check_sysuser=$(php -r '$reserved_names=array("aria", "aria_log", "mysql", "mysql_upgrade", "ib", "ib_buffer",
35-
"ddl", "ddl_recovery", "performance"); if(in_array(strtolower($argv[1]), $reserved_names, true)){echo implode(", ", $reserved_names);}' "$user" );
36+
"ddl", "ddl_recovery", "performance", "sudo"); if(in_array(strtolower($argv[1]), $reserved_names, true)){echo implode(", ", $reserved_names);}' "$user" );
3637
if [ -n "$check_sysuser" ]; then
3738
check_result "$E_INVALID" "The user name '$user' is reserved and cannot be used. List of reserved names: $check_sysuser"
3839
return

bin/v-add-web-domain-redirect

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,18 @@ is_object_unsuspended 'user' 'USER' "$user"
4242
is_object_valid 'web' 'DOMAIN' "$domain"
4343
is_object_unsuspended 'web' 'DOMAIN' "$domain"
4444

45-
scheme=0
4645
if [[ "$3" =~ http://|https:// ]]; then
4746
scheme=1
48-
regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
49-
if ! [[ "$3" =~ $regex ]]; then
50-
echo "Invalid redirect"
51-
exit 2;
47+
isValidUrl=$(php -r '$url=$argv[1]; $url=filter_var($url,FILTER_VALIDATE_URL); echo $url;' "$3")
48+
if [ -z "$isValidUrl" ]; then
49+
check_result $E_INVALID "Invalid redirect"
5250
fi
5351
else
54-
regex='[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
55-
if ! [[ "$3" =~ $regex ]]; then
56-
echo "Invalid redirect"
57-
exit 2;
52+
isValidUrl=$(php -r '$url=$argv[1]; $url=filter_var($url,FILTER_VALIDATE_URL); echo $url;' "http://$3")
53+
if [ -z "$isValidUrl" ]; then
54+
check_result $E_INVALID "Invalid redirect"
5855
fi
59-
fi
56+
fi
6057

6158
# Perform verification if read-only mode is enabled
6259
check_hestia_demo_mode

install/hst-install-debian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ HESTIA_COMMON_DIR="$HESTIA/install/common"
3232
VERBOSE='no'
3333

3434
# Define software versions
35-
HESTIA_INSTALL_VER='1.6.6~alpha'
35+
HESTIA_INSTALL_VER='1.6.7~alpha'
3636
# Dependencies
3737
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1")
3838
fpm_v="8.0"

install/hst-install-ubuntu.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ HESTIA_COMMON_DIR="$HESTIA/install/common"
3232
VERBOSE='no'
3333

3434
# Define software versions
35-
HESTIA_INSTALL_VER='1.6.6~alpha'
35+
HESTIA_INSTALL_VER='1.6.7~alpha'
3636
# Dependencies
3737
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1")
3838
fpm_v="8.0"
@@ -1335,6 +1335,8 @@ fi
13351335
if [ -n "$(grep ^admin: /etc/group)" ] && [ "$force" = 'yes' ]; then
13361336
groupdel admin > /dev/null 2>&1
13371337
fi
1338+
# Remove sudo "default" sudo permission admin user group should not exists any way
1339+
sed -i "s/%admin ALL=(ALL) ALL/#%admin ALL=(ALL) ALL/g" /etc/sudoers
13381340

13391341
# Enable sftp jail
13401342
echo "[ * ] Enable SFTP jail..."

install/upgrade/versions/1.6.7.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Hestia Control Panel upgrade script for target version 1.6.7
4+
5+
#######################################################################################
6+
####### Place additional commands below. #######
7+
#######################################################################################
8+
####### Pass through information to the end user in case of a issue or problem #######
9+
####### #######
10+
####### Use add_upgrade_message "My message here" to include a message #######
11+
####### in the upgrade notification email. Example: #######
12+
####### #######
13+
####### add_upgrade_message "My message here" #######
14+
####### #######
15+
####### You can use \n within the string to create new lines. #######
16+
#######################################################################################
17+
18+
upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'no'
19+
upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'no'
20+
upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'no'
21+
upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'no'
22+
upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false'

src/deb/hestia/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Source: hestia
22
Package: hestia
33
Priority: optional
4-
Version: 1.6.6~alpha
4+
Version: 1.6.7~alpha
55
Section: admin
66
Maintainer: HestiaCP <info@hestiacp.com>
77
Homepage: https://www.hestiacp.com

0 commit comments

Comments
 (0)