Skip to content

Commit 3013ef1

Browse files
committed
Added warning message when parameter-value setting in profile contains unexpected characters.
1 parent 37b2a3a commit 3013ef1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

plugins/malleable_redirector.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,11 @@ def parse(self, path):
262262

263263
else:
264264
for n in compregexes['parameter-value'].finditer(restofline):
265-
paramval = list(filter(lambda x: x != None, n.groups()[1:]))[0]
266-
values.append(paramval.replace('\\\\', '\\'))
265+
try:
266+
paramval = list(filter(lambda x: x != None, n.groups()[1:]))[0]
267+
values.append(paramval.replace('\\\\', '\\'))
268+
except Exception as e:
269+
self.logger.fatal(f'Could not process line as ([set] parameter ["value", ...] :\n\n\t{line}\n\nMake sure your line doesnt include apostrophes, or other characters breaking compregexes["parameter-value"] regex.')
267270

268271
if values == []:
269272
values = ''
@@ -1891,7 +1894,7 @@ def _client_request_inspect(self, section, variant, req, req_body, malleable_met
18911894
self.drop_reason(f'[DROP, {ts}, reason:0, {peerIP}] identical request seen before. Possible Replay-Attack attempt.')
18921895
ret = self.report(True, ts, peerIP, req.uri, userAgentValue, '0')
18931896
if ret == True:
1894-
return (True, '0')
1897+
return (True, '0')
18951898
else:
18961899
return (False, '0')
18971900

0 commit comments

Comments
 (0)