From 36758323bcfadea0be39db15789dcccbe1e2c89d 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 0a62c77e36..f9b6e0f42f 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -486,6 +486,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()]); @@ -576,6 +584,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