subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
import subprocess try: cmd = f"hcloud IAM KeystoneListProjects --cli-region={region} --cli-output=json" result = subprocess.run( cmd, capture_output=True, timeout=15, encoding="utf-8", errors="replace", shell=True, )- Confidence
- 98% confidence
- Finding
- The script builds a shell command with an attacker-controlled region value and executes it with shell=True. If a user can supply a crafted region string, this can lead to command injection and arbitrary command execution in the local environment running the skill.
