subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
escaped_arg = call_arg.replace('"', '\\"') cmd_str = f'mcporter call "exa.{escaped_arg}"' result = subprocess.run( cmd_str, shell=True, capture_output=True,- Confidence
- 98% confidence
- Finding
- This is a true vulnerability because untrusted user-controlled input is interpolated into a shell command and executed with shell=True. Escaping only double quotes is insufficient; shell metacharacters such as backticks, $(), semicolons, and variable expansion can still alter command behavior, leading to command injection.
