subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def detect_copier(rsync_bin=RSYNC): try: p = subprocess.run([rsync_bin, "--version"], capture_output=True, text=True, timeout=20) out = (p.stdout or "") + (p.stderr or "") except Exception as e: return "absent", str(e)- Confidence
- 86% confidence
- Finding
- The script allows a caller-controlled --rsync-bin path to be executed directly via subprocess.run. Although it is not passed through a shell, this still permits arbitrary local program execution if an attacker can influence CLI arguments or the surrounding workflow, which is especially relevant in an automation skill that handles backups.
