T09 · Insecure Skill Coding Practices
- Location
ai_agent.py:287- Finding
Unapproved Full-Screen Disclosure to an Arbitrary LLM Client
- Content
View full analysis
List[Dict]: """Use LLM for intelligent task planning.""" # Capture current state screenshot = self.dc.screenshot() if screenshot: # Convert to base64 for LLM buffered = io.BytesIO() screenshot.save(buffered, format="PNG") img_b64 = base64.b64encode(buffered.getvalue()).decode() prompt = f"""Given this desktop screenshot, create a plan to: {task} Return a JSON list of steps, each with: - type: action type - description: what to do - [other relevant parameters] Available actions: launch, click, type, hotkey, wait, screenshot""" try: response = self.llm.generate(prompt, images=[img_b64]) ``` ### Technical Analysis When local pattern matching cannot plan a task and an LLM client is configured, the agent automatically captures the entire desktop. It serializes the screenshot as PNG, Base64-encodes it, and passes the encoded image to the caller-provided `LLMClient`. Base64 is a transport encoding and provides no confidentiality or access control. The `LLMClient` protocol does not constrain the implementation, endpoint, retention policy, or geographic destination. The code also lacks: - Explicit consent before transmitting the image - Screen-region restriction - Sensitive-window detection - Secret or personal-data redaction - Endpoint allowlisting - Data-classification checks - A local-only planning fallback Desktop screenshots can expose passwords, authentication tokens, private messages, customer records, source code, financial data, or other applications unrelated to the requested task. Sending the full desktop exceeds the minimum privilege required for many planning operations. The proj ...[truncated 1305 chars]- Remediation
View remediation
