Remove the `blacklist_hostnames` option
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 28 Jan 2021 08:51:10 +0000 (09:51 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 28 Jan 2021 08:51:10 +0000 (09:51 +0100)
The hostname blocklist requires a PTR lookup for every single request. This is
slow and unreliable.

see #3909

com.woltlab.wcf/option.xml
constants.php
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/options.inc.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index cd347cefe2ccf0a657aeff1b0ce3458bdde61126..8c4d12f4a09f71fa5a31f114428481097634f2cc 100644 (file)
@@ -722,10 +722,6 @@ block:wcf.acp.option.blacklist_sfs_action.block]]></selectoptions>
                                <categoryname>security.blacklist.custom</categoryname>
                                <optiontype>textarea</optiontype>
                        </option>
-                       <option name="blacklist_hostnames">
-                               <categoryname>security.blacklist.custom</categoryname>
-                               <optiontype>textarea</optiontype>
-                       </option>
                        <!-- /security.blacklist.custom -->
                        <!-- security.antispam.captcha -->
                        <option name="captcha_type">
@@ -1704,5 +1700,6 @@ DESC:wcf.global.sortOrder.descending</selectoptions>
                <option name="session_validate_ip_address" />
                <option name="session_validate_user_agent" />
                <option name="session_enable_virtualization" />
+               <option name="blacklist_hostnames" />
        </delete>
 </data>
index e38294011f28ea025571cbe1549c6ae55f44dc37..c32d15669c5eb0cd5ac87619543589e6a02d850b 100644 (file)
@@ -80,7 +80,6 @@ define('USER_AUTHENTICATION_FAILURE_EXPIRATION', 30);
 define('SIGNATURE_SECRET', '');
 define('BLACKLIST_IP_ADDRESSES', '');
 define('BLACKLIST_USER_AGENTS', '');
-define('BLACKLIST_HOSTNAMES', '');
 define('CAPTCHA_TYPE', 'com.woltlab.wcf.recaptcha');
 define('REGISTER_USE_CAPTCHA', 1);
 define('LOST_PASSWORD_USE_CAPTCHA', 1);
index 7c9ae4d70c541b1a1e22d21d6b8608a99f08d2f5..f3e2dac4f701d6c146e20a21022c8d4e9dde997c 100644 (file)
@@ -419,6 +419,10 @@ class WCF
         // https://github.com/WoltLab/WCF/issues/3674
         \define('REGISTER_ADMIN_NOTIFICATION', 0);
 
+        // The hostname blocklist was removed in 5.4.
+        // https://github.com/WoltLab/WCF/issues/3909
+        \define('BLACKLIST_HOSTNAMES', '');
+
         $filename = WCF_DIR . 'options.inc.php';
 
         // create options file if doesn't exist
@@ -551,18 +555,7 @@ class WCF
                 }
             }
         }
-        if (\defined('BLACKLIST_HOSTNAMES') && BLACKLIST_HOSTNAMES != '') {
-            if (!StringUtil::executeWordFilter(@\gethostbyaddr(UserUtil::getIpAddress()), BLACKLIST_HOSTNAMES)) {
-                if ($isAjax) {
-                    throw new AJAXException(
-                        self::getLanguage()->getDynamicVariable('wcf.ajax.error.permissionDenied'),
-                        AJAXException::INSUFFICIENT_PERMISSIONS
-                    );
-                } else {
-                    throw new PermissionDeniedException();
-                }
-            }
-        }
+
 
         // handle banned users
         if (self::getUser()->userID && self::getUser()->banned && !self::getUser()->hasOwnerAccess()) {
index e319e37ef8f02814b72e56805476cedd77b16de9..e5a7210d9b90dcc7f80d557689c230667395b1d8 100644 (file)
@@ -26,7 +26,6 @@ if (\file_exists(WCF_DIR . 'cookiePrefix.txt')) {
 
 \define('BLACKLIST_IP_ADDRESSES', '');
 \define('BLACKLIST_USER_AGENTS', '');
-\define('BLACKLIST_HOSTNAMES', '');
 
 \define('CACHE_SOURCE_TYPE', 'disk');
 \define('IMAGE_ADAPTER_TYPE', 'gd');
index 4242097b9bfc4d2f2f1290968f315273d7099050..e27051d9d36f42c90db9fecb7746709899e5cd83 100644 (file)
@@ -1253,8 +1253,6 @@ ACHTUNG: Die oben genannten Meldungen sind stark gekürzt. Sie können Details z
                <item name="wcf.acp.notice.showOrder.description"><![CDATA[Legt die Reihenfolge fest, in der die Hinweise angezeigt werden.]]></item>
        </category>
        <category name="wcf.acp.option">
-               <item name="wcf.acp.option.blacklist_hostnames"><![CDATA[Hostname ausschließen]]></item>
-               <item name="wcf.acp.option.blacklist_hostnames.description"><![CDATA[Ein Hostname pro Zeile]]></item>
                <item name="wcf.acp.option.blacklist_ip_addresses"><![CDATA[IP-Adresse ausschließen]]></item>
                <item name="wcf.acp.option.blacklist_ip_addresses.description"><![CDATA[Eine Adresse pro Zeile]]></item>
                <item name="wcf.acp.option.blacklist_user_agents"><![CDATA[Browser-Kennung ausschließen]]></item>
index 2a4e153609936f82feae6ca4a9c8c4b8291d0084..41930a892f508623bedcc8078fe9c64f3de6e2a8 100644 (file)
@@ -1230,8 +1230,6 @@ ATTENTION: The messages listed above are greatly shortened. You can view details
                <item name="wcf.acp.notice.showOrder.description"><![CDATA[Choose display order of notices.]]></item>
        </category>
        <category name="wcf.acp.option">
-               <item name="wcf.acp.option.blacklist_hostnames"><![CDATA[Block by Hostname]]></item>
-               <item name="wcf.acp.option.blacklist_hostnames.description"><![CDATA[You can specify which hostnames will be blacklisted. Enter one hostname per line.]]></item>
                <item name="wcf.acp.option.blacklist_ip_addresses"><![CDATA[Block by IP Address]]></item>
                <item name="wcf.acp.option.blacklist_ip_addresses.description"><![CDATA[You can specify which IP addresses will be blacklisted. Enter one IP address per line.]]></item>
                <item name="wcf.acp.option.blacklist_user_agents"><![CDATA[Block by User-Agent]]></item>