T09 · Insecure Skill Coding Practices
- Location
bundle/windows-sidecar/src/oc_wx_bridge/adapters/uiautomation_adapter.py:296- Finding
WeChat Screenshots Can Be Transmitted to an Arbitrary VLM Endpoint
- Content
View full analysis
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
View remediation
