subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def search(self, query: str, max_results: int = 5) -> Optional[NewsSearchResult]: try: # 调用 mcporter result = subprocess.run( ['mcporter', 'call', 'zhipu-search.web_search_prime', '--arg', f'query={query}'], capture_output=True, timeout=30,- Confidence
- 89% confidence
- Finding
- The code invokes an external program (`mcporter`) with user-influenced input embedded in the `--arg` value. Although `subprocess.run` is used without a shell, this still delegates trust to an external tool that may interpret the query string unsafely, and it expands the skill's attack surface by allowing arbitrary agent-provided input to reach a local executable.
