diff options
author | Joas Schilling <coding@schilljs.com> | 2023-12-04 10:38:46 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-12-04 10:38:46 +0100 |
commit | 33e1c8b2361094be5466f5717bfa88ede7463784 (patch) | |
tree | fafd007ce53b3ff41e5dfb93d8ab601f6dd0e7e5 /lib | |
parent | df7bc46eab01ee50eba0af7e51c876bfad2625a7 (diff) | |
download | nextcloud-server-33e1c8b2361094be5466f5717bfa88ede7463784.tar.gz nextcloud-server-33e1c8b2361094be5466f5717bfa88ede7463784.zip |
fix(security): Handle idn_to_utf8 returning false
Signed-off-by: Joas Schilling <coding@schilljs.com>
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); |