diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-12-04 13:59:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 13:59:00 +0100 |
commit | a5eaa5631495128cf7ff18649b0803c346801b33 (patch) | |
tree | f05936d5b5e521bb4bda2c9312974d09e0d1da3a /lib | |
parent | b6dd7197110076aa0ae633c7766df8552fd7ad95 (diff) | |
parent | 704751f86831621dec1da588e0b62f815831d55c (diff) | |
download | nextcloud-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.php | 4 |
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); |