T09 · Insecure Skill Coding Practices
Error
- Location
- bundle/windows-sidecar/src/oc_wx_bridge/adapters/uiautomation_adapter.py:296
- Finding
- WeChat Screenshots Can Be Transmitted to an Arbitrary VLM Endpoint<![CDATA[ ## Vulnerability Details **File Location**: `bundle/windows-sidecar/src/oc_wx_bridge/adapters/uiautomation_adapter.py:296-355` **Vulnerability Type**: Privacy-sensitive data transmission to a configuration-controlled endpoint **Risk Level**: High ### Vulnerable Code ```python def _image_to_base64(self, image: object) -> str: max_side = 1200 image_copy = image.copy() width = getattr(image_copy, "width", 0) height = getattr(image_copy, "height", 0) if width > max_side or height > max_side: image_copy.thumbnail((max_side, max_side)) buffer = io.BytesIO() image_copy.save(buffer, format="PNG") return base64.b64encode(buffer.getvalue()).decode("ascii") def _extract_with_vlm(self, image: object) -> str | None: base_url = self.visual_config.vlm_base_url api_key = (self.visual_config.vlm_api_key or "").strip() if "api.openai.com" in base_url and not api_key: return None try: image_b64 = self._image_to_base64(image) payload = { "model": self.visual_config.vlm_model, "temperature": 0, "max_tokens": 100, "messages": [ { "role": "system", "content": ( "Extract only the latest user-authored WeChat message text from the screenshot. " "Prefer the newest actionable command such as /mail, /watch, 查邮箱, or a visible email query. " "Ignore timestamps, chat chrome, previous automation replies, and decorative labels. " "If unreadable, return an empty string." ), }, { "role": "user", "content": [ { "type": "text", "text": ( "Return only the exact raw latest message text, no JSON. " ...[truncated 2895 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Default visual processing to `off` or local OCR-only mode. 2. Require explicit operator consent before enabling remote VLM processing. 3. Enforce HTTPS for all non-loopback VLM endpoints. 4. Maintain an explicit allowlist of trusted VLM hosts and reject unexpected redirects. 5. Require credentials for remote endpoints rather than allowing unauthenticated arbitrary destinations. 6. Crop the image to the latest message bubble or otherwise redact previous messages, names, and unrelated UI data before transmission. 7. Display a clear startup warning identifying the exact destination receiving screenshots. 8. Add audit logging that records when an image is transmitted without logging the image or API key. 9. Support a fully local VLM option for deployments that handle sensitive communications. 10. Separate OCR fallback from remote VLM fallback so low OCR confidence does not silently trigger external disclosure. ]]>
