fix(db): use parameterized queries to prevent SQL injection in getJailNames

This commit is contained in:
limuthu123 2026-05-31 01:37:16 +05:30
parent 557e7eecf9
commit 3282035568

View file

@ -443,7 +443,7 @@ class Fail2BanDb(object):
if enabled is None:
cur.execute("SELECT name FROM jails")
else:
cur.execute("SELECT name FROM jails WHERE enabled=%s" %
cur.execute("SELECT name FROM jails WHERE enabled=?",
(int(enabled),))
return set(row[0] for row in cur.fetchmany())