subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
Path(temp_wav).unlink(missing_ok=True) """ result = subprocess.run( ["python3", "-c", test_code], capture_output=True, text=True,- Confidence
- 87% confidence
- Finding
- This spawns 'python3 -c' and sets cwd to a user-writable workspace while the inline code prepends '.' to sys.path. That combination can cause import hijacking if a malicious file in the workspace shadows standard or expected modules, leading to execution of unintended local code during the health check.
