subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
raise Exception("Ollama model is missing and automatic model pull is disabled") self._log(f"Model {self.embedding_model} not found. Installing...", "WARN") self._show_progress(0, 1, "Installing model", self.embedding_model) install_result = subprocess.run(['ollama', 'pull', self.embedding_model], capture_output=True, text=True) self._show_progress(1, 1, "Installing model", self.embedding_model) if install_result.returncode == 0:- Confidence
- 89% confidence
- Finding
- This code can automatically execute `ollama pull <model>` based on environment/CLI-controlled configuration, causing network access and local system modification without a strong interactive confirmation at execution time. While it is not shell injection, it does allow unexpected package/model retrieval from an external source, which increases supply-chain and policy risk in automated environments.
