subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def complete(self, system: str, user: str) -> str: prompt = f"<system>\n{system}\n</system>\n\n<user>\n{user}\n</user>\n" try: r = subprocess.run(self.cmd, input=prompt, capture_output=True, text=True, encoding="utf-8", timeout=self.timeout) except subprocess.TimeoutExpired as e: raise AIError(f"CLI provider timed out after {self.timeout}s: {e}")- Confidence
- 92% confidence
- Finding
- The CLI provider executes an arbitrary external command from configuration and passes model prompts to it. Although `shell=True` is not used, this still creates a command-execution boundary where sensitive notebook contents may be sent to any local or remote-capable binary, which is risky in an agent skill that may process untrusted source material.
