subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# Step 2: Convert to PDBQT with AutoDock Tools script or obabel cmd = f"obabel {temp_pdb} -O {self.prepared_pdbqt} -xr -h --partialcharge gasteiger" subprocess.run(cmd, shell=True, check=True, capture_output=True) os.remove(temp_pdb) return self.prepared_pdbqt- Confidence
- 98% confidence
- Finding
- This constructs a shell command with file paths derived from user-controlled output_dir and then executes it with shell=True. If the output path contains shell metacharacters, an attacker can trigger OS command injection and execute arbitrary commands under the agent's privileges.
