subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
cmd = [str(Path(sys.executable)), str(script_path)] # run in the ASR directory so generated files land in the right place result = subprocess.run( cmd, capture_output=True, text=True,- Confidence
- 94% confidence
- Finding
- This code executes setup.py or download_model.py from a dynamically discovered ASR directory with no trust validation. Because the code auto-scans drives for *_openvino/asr and can auto-bootstrap when files are missing, an attacker who can place a malicious directory or replace those scripts can achieve arbitrary code execution under the current user.
