Skip to content

Commit

Permalink
修复插件shell命令注入漏洞
Browse files Browse the repository at this point in the history
修复插件shell命令注入漏洞
  • Loading branch information
nick2wang committed Jan 5, 2022
1 parent af13722 commit 98e353a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sql/plugins/binglog2sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def generate_args2cmd(self, args, shell):
'start-datetime', 'stop-datetime']
filter_options = ['databases', 'tables', 'only-dml', 'sql-type']
if shell:
cmd_args = f'python {self.path}' if self.path else ''
cmd_args = f'python {shlex.quote(str(self.path))}' if self.path else ''
for name, value in args.items():
if name in conn_options:
cmd_args += f' {value}'
Expand Down
2 changes: 1 addition & 1 deletion sql/plugins/soar.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def generate_args2cmd(self, args, shell):
:return:
"""
if shell:
cmd_args = self.path if self.path else ''
cmd_args = shlex.quote(str(self.path)) if self.path else ''
for name, value in args.items():
cmd_args += f" -{name}={shlex.quote(str(value))}"
else:
Expand Down
2 changes: 1 addition & 1 deletion sql/plugins/sqladvisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def generate_args2cmd(self, args, shell):
:return:
"""
if shell:
cmd_args = self.path if self.path else ''
cmd_args = shlex.quote(str(self.path)) if self.path else ''
for name, value in args.items():
cmd_args += f" -{name} {shlex.quote(str(value))}"
else:
Expand Down

0 comments on commit 98e353a

Please sign in to comment.