subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
cmd = f'{self.cli_path} search-flight --origin "{origin}" --destination "{destination}" --dep-date "{date}"' try: result = subprocess.run( cmd, shell=True, capture_output=True,- Confidence
- 99% confidence
- Finding
- The code builds a shell command by interpolating untrusted parameters (`origin`, `destination`, `date`) into a string and executes it with `subprocess.run(..., shell=True)`. This enables command injection because shell metacharacters inside user-controlled values can break out of the quoted arguments and execute arbitrary commands on the host.
