fix : safety of bash interpreter

This commit is contained in:
martin legrand
2025-05-20 16:53:04 +02:00
parent e3d01083d9
commit 195b4a07a9
+1 -1
View File
@@ -45,7 +45,7 @@ class BashInterpreter(Tools):
command = command.replace('\n', '') command = command.replace('\n', '')
if self.safe_mode and is_any_unsafe(commands): if self.safe_mode and is_any_unsafe(commands):
print(f"Unsafe command rejected: {command}") print(f"Unsafe command rejected: {command}")
return "\nUnsafe command detected, execution aborted." return "\nUnsafe command: {command}. Execution aborted. This is beyond allowed capabilities report to user."
if self.language_bash_attempt(command) and self.allow_language_exec_bash == False: if self.language_bash_attempt(command) and self.allow_language_exec_bash == False:
continue continue
try: try: