aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-12-04 13:59:00 +0100
committerGitHub <noreply@github.com>2023-12-04 13:59:00 +0100
commita5eaa5631495128cf7ff18649b0803c346801b33 (patch)
treef05936d5b5e521bb4bda2c9312974d09e0d1da3a /lib
parentb6dd7197110076aa0ae633c7766df8552fd7ad95 (diff)
parent704751f86831621dec1da588e0b62f815831d55c (diff)
downloadnextcloud-server-a5eaa5631495128cf7ff18649b0803c346801b33.tar.gz
nextcloud-server-a5eaa5631495128cf7ff18649b0803c346801b33.zip
Merge pull request #42005 from nextcloud/backport/41999/stable28
[stable28] fix(security): Handle idn_to_utf8 returning false
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Security/RemoteHostValidator.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Security/RemoteHostValidator.php b/lib/private/Security/RemoteHostValidator.php
index 385b38cff98..9cc69594c32 100644
--- a/lib/private/Security/RemoteHostValidator.php
+++ b/lib/private/Security/RemoteHostValidator.php
@@ -52,6 +52,10 @@ final class RemoteHostValidator implements IRemoteHostValidator {
}
$host = idn_to_utf8(strtolower(urldecode($host)));
+ if ($host === false) {
+ return false;
+ }
+
// Remove brackets from IPv6 addresses
if (str_starts_with($host, '[') && str_ends_with($host, ']')) {
$host = substr($host, 1, -1);