subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
} def run(cmd): return subprocess.run(cmd, shell=True, capture_output=True, text=True).stdout.strip() def load_config(): if os.path.exists(CONFIG_PATH):- Confidence
- 97% confidence
- Finding
- The helper wraps subprocess.run with shell=True and is later used with formatted command strings that incorporate variable data such as executable paths and click coordinates. Even if the current inputs are mostly local, this creates a command-injection primitive if any upstream value becomes attacker-controlled or is spoofed by filesystem state, and it expands the blast radius of any future code changes.
