T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- driftwatch.py:33
- Finding
- Tracked Workspace Content Is Disclosed to an External LLM by Default<![CDATA[ ## Vulnerability Details **File Location**: `driftwatch.py:33-49, 152-159, 187-192, 336-340` **Vulnerability Type**: Sensitive information disclosure to an external service **Risk Level**: High ### Vulnerable Code ```python TRACKED_FILES = [ "SOUL.md", "IDENTITY.md", "USER.md", "AGENTS.md", "TOOLS.md", "agents/jet/MEMORY-INDEX.md", "agents/forge/MEMORY-INDEX.md", "agents/quill/MEMORY-INDEX.md", "agents/scout/MEMORY-INDEX.md", "agents/oracle/MEMORY-INDEX.md", "agents/atlas/MEMORY-INDEX.md", "agents/pixel/MEMORY-INDEX.md", "agents/render/MEMORY-INDEX.md", "agents/cipher/MEMORY-INDEX.md", ] ``` ```python items = [] for i, c in enumerate(changes): diff_snippet = c.get("diff", "")[:800] # Keep each snippet small items.append(f"""CHANGE_{i}: File: {c['file']} Commit: {c['message']} Lines +{c['lines_added']}/-{c['lines_removed']} Diff snippet: {diff_snippet} """) ``` ```python result = subprocess.run( ["claude", "--print", "--model", "claude-haiku-4-5", prompt], capture_output=True, text=True, timeout=60 ) ``` ```python use_llm = not args.no_llm cron_mode = args.cron if cron_mode: use_llm = True # Always use LLM in cron mode for accurate analysis tracked = args.files or TRACKED_FILES ``` ### Technical Analysis The program collects Git diffs from files that may contain private user information, agent memory, behavioral rules, and access or tooling notes. It then embeds up to 800 characters from each change in a prompt passed to the external `claude` command. External LLM processing is enabled by default unless the user supplies `--no-llm`. In cron mode, external processing is forcibly enabled. Consequently, invoking the documented default workflow can transfer repository content outside the local workspace without a dedicated consent step or content-sensitivity check. The 800-character limit does not provide confidentiality. Secrets, personal details, tokens, interna ...[truncated 1513 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Disable external LLM analysis by default and require an explicit option such as `--enable-external-llm`. 2. Do not forcibly enable external processing in cron mode. 3. Display a clear consent notice identifying which files and content will leave the workspace. 4. Exclude high-risk files such as `USER.md`, `TOOLS.md`, and memory files from external processing unless explicitly selected. 5. Run secret and personal-data redaction before constructing the prompt. 6. Prefer a local model or deterministic local analysis for sensitive repositories. 7. Permit users to preview the exact outbound prompt before transmission. 8. Document the external processing destination, applicable retention behavior, and trust assumptions. 9. Add tests confirming that known credential patterns and sensitive fields are removed before external analysis. ]]>
