subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: # 运行 terraform init result = subprocess.run( ["terraform", "init"], cwd=test_dir, capture_output=True,- Confidence
- 90% confidence
- Finding
- The script executes `terraform init` as part of a provider test, which goes beyond a local installer and can trigger network access, plugin resolution, and execution of whatever `terraform` binary is first on PATH. In an agent/automation context, invoking external tooling during installation materially increases risk because a trojaned Terraform binary or manipulated PATH could cause arbitrary code execution or unintended cloud-facing actions.
