T07 · Tool Hijacking and Spoofing
- Location
tools/jimeng_tool.py:28- Finding
Untrusted External Automation Script Discovery and Execution
- Content
View full analysis
Optional[str]: """查找即梦自动化脚本""" possible_paths = [ os.path.join(os.path.dirname(__file__), '../../jimeng/scripts/jimeng_auto.py'), os.path.expanduser('~/.openclaw/workspace/skills/jimeng/scripts/jimeng_auto.py'), 'skills/jimeng/scripts/jimeng_auto.py' ] for path in possible_paths: if os.path.exists(path): return os.path.abspath(path) return None ``` ```python def _call_script(self, prompt: str, negative_prompt: str, quantity: int, output_path: str, kwargs: Dict) -> Dict: cmd = [ "python", self.script_path, "--prompt", prompt, "--output", output_path, "--count", str(quantity) ] if negative_prompt: cmd.extend(["--negative", negative_prompt]) for key, value in kwargs.items(): cmd.extend([f"--{key}", str(value)]) process = subprocess.run( cmd, capture_output=True, text=True, timeout=300 ) ``` The Liblib wrapper uses the same trust model and execution pattern: ```python possible_paths = [ os.path.join(os.path.dirname(__file__), '../../liblib/scripts/liblib_auto.py'), os.path.expanduser('~/.openclaw/workspace/skills/liblib/scripts/liblib_auto.py'), 'skills/liblib/scripts/liblib_auto.py' ] for path in possible_paths: if os.path.exists(path): return os.path.abspath(path) ``` ```python process = subprocess.run( cmd, capture_output=True, text=True, timeout=300 ) ``` ### Technical Analysis The wrappers search for automation scripts outside the audited package, including paths under the user's OpenClaw workspace and paths relative t ...[truncated 2976 chars]- Remediation
View remediation
