[MIRROR] SQL Injection Fix (#6789)

Co-authored-by: Casey <a.roaming.shadow@gmail.com>
Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
This commit is contained in:
CHOMPStation2
2023-08-13 22:30:42 +02:00
committed by GitHub
co-authored by Casey CHOMPStation2
parent be12322970
commit 3e1cd79788
2 changed files with 8 additions and 3 deletions
+2 -3
View File
@@ -46,11 +46,11 @@
var/cidquery = ""
if(address)
failedip = 0
ipquery = " OR ip = '[address]' "
ipquery = " OR ip = '[sanitizeSQL(address)]' "
if(computer_id)
failedcid = 0
cidquery = " OR computerid = '[computer_id]' "
cidquery = " OR computerid = '[sanitizeSQL(computer_id)]' "
var/DBQuery/query = SSdbcore.NewQuery("SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype FROM erro_ban WHERE (ckey = :t_ckey [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR (bantype = 'TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)", list("t_ckey" = ckeytext)) //CHOMPEdit TGSQL
@@ -81,4 +81,3 @@
message_admins("[key] has logged in with a blank ip in the ban check.")
return ..() //default pager ban stuff
#endif