mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-02 22:02:13 +08:00
fix: use subprocess instead of os.system in analyze.py (#1289)
The data analysis skill executes shell commands using os Resolves V-001 Co-authored-by: orbisai0security <orbisai0security@users.noreply.github.com>
This commit is contained in:
@@ -12,7 +12,7 @@ from typing import Optional
|
||||
def run_command(command: list[str]) -> Optional[str]:
|
||||
"""Run a command and return trimmed stdout, or None on failure."""
|
||||
try:
|
||||
result = subprocess.run(command, capture_output=True, text=True, check=True)
|
||||
result = subprocess.run(command, capture_output=True, text=True, check=True, shell=False)
|
||||
except (OSError, subprocess.CalledProcessError):
|
||||
return None
|
||||
return result.stdout.strip() or result.stderr.strip()
|
||||
|
||||
Reference in New Issue
Block a user