subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# 兜底实现 import subprocess cmd = f"mcporter call exa.web_search_exa query='{query}' numResults={num_results}" result = subprocess.run(cmd, shell=True, capture_output=True, text=True) return result.stdout- Confidence
- 99% confidence
- Finding
- The fallback path builds a shell command with user-controlled input (`query`) and executes it with `shell=True`. This enables command injection if an attacker can supply crafted search text containing shell metacharacters, allowing arbitrary command execution in the skill's runtime environment.
