security: strip newlines embedded in parameters to prevent arbitrary command execution
This commit is contained in:
parent
4bc268f5a4
commit
1281756d49
|
@ -17,6 +17,7 @@ def decode(txt):
|
|||
|
||||
|
||||
def censor(text):
|
||||
text = text.replace('\n', '').replace('\r', '')
|
||||
replacement = '[censored]'
|
||||
if 'censored_strings' in bot.config:
|
||||
words = map(re.escape, bot.config['censored_strings'])
|
||||
|
|
Loading…
Reference in New Issue