subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
for attempt in range(max_retries): try: result = subprocess.run( command, shell=True, capture_output=True, text=True, timeout=60 )- Confidence
- 99% confidence
- Finding
- The code executes a dynamically constructed shell command with shell=True, and the command includes user-controlled values such as instance_id, database name, message_id, and especially raw SQL text. Because these values are interpolated directly into the shell command, an attacker can inject shell metacharacters and execute arbitrary commands on the host running the skill.
