From 1a9ed768846b2672fddd6ed15a935a5f5d42c449 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 26 May 2023 17:49:51 +0200 Subject: [PATCH] Continued: - someone removed these checks, if the GServer's url is blocked, flooders like activitypub-troll.cf will then be able to flood your gserver table again MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- src/Model/GServer.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 0c839a78e1..8295a02ea5 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -471,6 +471,14 @@ class GServer return; } + if (Network::isUrlBlocked($url)) { + Logger::info('Server domain is blocked', ['url' => $url]); + return; + } elseif (Network::isUrlBlocked($nurl)) { + Logger::info('Server domain is blocked', ['nurl' => $nurl]); + return; + } + self::insert(['url' => $url, 'nurl' => $nurl, 'network' => Protocol::PHANTOM, 'created' => DateTimeFormat::utcNow(), 'failed' => true, 'last_failure' => DateTimeFormat::utcNow()]); @@ -561,6 +569,9 @@ class GServer self::detect($url, $network, $only_nodeinfo); } return false; + } elseif (Network::isUrlBlocked($url)) { + Logger::info('Server domain is blocked', ['url' => $url]); + return false; } $valid_url = Network::isUrlValid($url); -- 2.39.5