subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def query(self, query_text: str, data_type: str = "api") -> dict: try: result = subprocess.run( ["python3", str(NEODATA_SCRIPT), "--query", query_text, "--data-type", data_type], capture_output=True, text=True, timeout=30 )- Confidence
- 88% confidence
- Finding
- The code launches an external Python script via subprocess using inputs that are at least partly dynamic (`query_text`, `data_type`) and a configurable script path (`NEODATA_SCRIPT`). Although it does not use `shell=True`, invoking external code expands the trust boundary, creates execution risk if the script path or called script is tampered with, and is stronger than ordinary in-process data retrieval.
