Fixes Fail2Topic IP Banning (#14573)

This commit is contained in:
SleepyGemmy
2022-08-10 12:26:27 +02:00
committed by GitHub
parent ba7f971b94
commit 32806fe578
2 changed files with 8 additions and 1 deletions

View File

@@ -83,7 +83,8 @@ var/datum/controller/subsystem/fail2topic/SSfail2topic
if (!enabled)
return
var/static/regex/R = regex(@"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$") // Anything that interacts with a shell should be parsed. Prevents subnet banning and possible injection vulnerabilities
ip = findtext(ip, R)
R.Find(ip)
ip = R.match
if(length(ip) > 15 || length(ip) < 8)
WARNING("BanFromFirewall was called with an invalid or unsafe IP")
return FALSE