T09 · Insecure Skill Coding Practices
- Location
scripts/vln_bridge.py:94- Finding
Unrestricted Local File Disclosure to a Configurable Network Endpoint
- Content
View full analysis
str: mime, _ = mimetypes.guess_type(path) mime = mime or "image/jpeg" with open(path, "rb") as f: encoded = base64.b64encode(f.read()).decode("ascii") return f"data:{mime};base64,{encoded}" ``` The encoded file contents are incorporated into the model request: ```python content: List[Dict[str, Any]] = [{"type": "text", "text": text}] for hf in history_frames: content.append({"type": "image_url", "image_url": {"url": image_to_data_url(hf)}}) content.append({"type": "image_url", "image_url": {"url": image_to_data_url(current_frame)}}) return [{"role": "user", "content": content}] ``` The request is then sent to the endpoint supplied by the configuration: ```python def call_openai_compatible(cfg: PlannerConfig, messages: List[Dict[str, Any]]) -> str: headers = { "Authorization": f"Bearer {cfg.api_key}", "Content-Type": "application/json", } payload = { "model": cfg.model_id, "messages": messages, "temperature": 0, "response_format": {"type": "json_object"}, } chat_url = f"{cfg.base_url}/chat/completions" resp = requests.post(chat_url, headers=headers, json=payload, timeout=cfg.timeout_seconds) resp.raise_for_status() return extract_text_from_response(resp.json()) ``` ### Technical Analysis Sending current and historical camera frames to a multimodal gateway is part of the Skill's declared functionality. Base64 encoding is also a normal implementation mechanism for image data URLs and is not, by itself, evidence of covert exfiltration. However, the implementation does not verify t ...[truncated 2722 chars]- Remediation
View remediation
