From c1eb6ac62105b05297fbd46ecf10d86ccdb9fb0c Mon Sep 17 00:00:00 2001 From: liqiang-fit2cloud Date: Mon, 17 Nov 2025 12:46:26 +0800 Subject: [PATCH] fix: fix incorrect permission may introduce security vulnerabilities. --- apps/common/utils/tool_code.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/common/utils/tool_code.py b/apps/common/utils/tool_code.py index 1c806fda1..fd86b6263 100644 --- a/apps/common/utils/tool_code.py +++ b/apps/common/utils/tool_code.py @@ -50,13 +50,10 @@ class ToolExecutor: os.makedirs(execute_file_path, 0o500, exist_ok=True) result_file_path = os.path.join(self.sandbox_path, 'result') os.makedirs(result_file_path, 0o300, exist_ok=True) - tmp_file_path = os.path.join(self.sandbox_path, 'tmp') - os.makedirs(tmp_file_path, 0o600, exist_ok=True) if self.sandbox: os.system(f"chown {self.user}:root {self.sandbox_path}") os.system(f"chown -R {self.user}:root {execute_file_path}") os.system(f"chown -R {self.user}:root {result_file_path}") - os.system(f"chown -R {self.user}:root {tmp_file_path}") os.chmod(self.sandbox_path, 0o550) def exec_code(self, code_str, keywords):