]> git.ipfire.org Git - ipfire.org.git/commitdiff
accounts: Reject subdomains of blacklisted domains, too
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Apr 2020 20:52:03 +0000 (20:52 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Apr 2020 20:52:03 +0000 (20:52 +0000)
Fixes: #12333
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/accounts.py

index 584a865823c83eacd95279e06c76a1c3dbcae2b8..2c9f460871c03876738cb96a7a26646e69a9b34b 100644 (file)
@@ -362,7 +362,7 @@ class Accounts(Object):
 
        def domain_is_blacklisted(self, domain):
                res = self.db.get("SELECT TRUE AS found FROM blacklisted_domains \
-                       WHERE domain = %s", domain)
+                       WHERE domain = %s OR %s LIKE '%%.' || domain", domain, domain)
 
                if res and res.found:
                        return True