subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# 应用patch cmd = ["patch", str(file_path), "-i", tmp_path] result = subprocess.run(cmd, capture_output=True, text=True, timeout=30) if result.returncode == 0: results["files_modified"].append(str(file_path))- Confidence
- 90% confidence
- Finding
- Although subprocess.run is called without a shell, it executes the external patch utility on patch content derived from proposal.diff_content. Because the diff content can originate from parsed changelog/template logic and there is no strong validation that the patch only modifies the intended file and path, this can lead to arbitrary file modification within the agent's privilege scope.
