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):
|
def censor(text):
|
||||||
|
text = text.replace('\n', '').replace('\r', '')
|
||||||
replacement = '[censored]'
|
replacement = '[censored]'
|
||||||
if 'censored_strings' in bot.config:
|
if 'censored_strings' in bot.config:
|
||||||
words = map(re.escape, bot.config['censored_strings'])
|
words = map(re.escape, bot.config['censored_strings'])
|
||||||
|
|
Loading…
Reference in New Issue