subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_cmd(cmd, capture=True): """Run a command and return output or None if fails.""" try: result = subprocess.run( cmd, shell=True, capture_output=capture,- Confidence
- 94% confidence
- Finding
- The helper executes shell commands with shell=True, which makes any interpolated value part of a shell command line rather than a safe argument list. In this file, gog_path and account-derived values are later embedded into command strings, so a malicious or malformed config value could trigger command injection during environment detection.
