T09 · Insecure Skill Coding Practices
- Location
minimax_vision.py:13- Finding
Unrestricted Local File Path Submission to the Vision Service
- Content
View full analysis
[问题]") sys.exit(1) image_path = sys.argv[1] prompt = sys.argv[2] if len(sys.argv) > 2 else "描述这张图片的内容" print(f"识别图片: {image_path}") print(f"问题: {prompt}") print("-" * 30) result = call_mcp(image_path, prompt) ``` ### Technical Analysis The script accepts an arbitrary path from `sys.argv[1]` and forwards it to `minimax.understand_image` as `image_source`. It does not canonicalize the path or verify that it: - Resides within the documented `~/.openclaw/media/inbound/` directory. - Refers to a regular file. - Is not a symbolic link. - Has an approved image extension. - Contains a valid supported image format. The restriction described in `SKILL.md` is therefore informational rather than enforced. An attacker who can influence the script invocation can supply an absolute path, directory-traversal path, or symbolic link targeting another readable local file. Whether the target file's contents are successfully processed or disclosed depends on how the configured MCP implementation interprets `image_source`. Nevertheless, the wrapper unnecessarily allows arbitrary local paths to cross the MCP trust boundary. ### Attack Path 1. An attacker obtains influence over the image-path argument, such as through an automated agent invocation or another component that passes user-controlled paths to this script. 2. The attacker supplies a sensitive readable path, a traversal path, or a symlink rather than a file in the approved inbound-media ...[truncated 850 chars]- Remediation
View remediation
