subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# Adjust the number of ".." based on your folder depth script_path = os.path.join(current_dir, "..", "..", "scripts", "your_script.py") process = subprocess.run(["python", script_path], capture_output=True, text=True) return process.stdout- Confidence
- 94% confidence
- Finding
- The skill executes an external Python script via subprocess without any validation, sandboxing, or clear necessity for the stated functionality. Even though the command is not shell-interpolated, this still creates code-execution risk because a modified or unexpected script at the referenced path will run with the agent's privileges.
