T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/gemini-run.sh:83- Finding
Auto-approved tool execution violates least-privilege boundaries
- Content
View full analysis
&1 | tee "$OUTPUT_FILE" ``` The associated documentation recommends broad grants: ```bash gemini \ --include-directories /root/.openclaw/workspace,/tmp/my-task \ --yolo \ -p "Read /root/.openclaw/workspace/spec.md and implement the feature" ``` ### Technical Analysis The wrapper unconditionally passes `--yolo`, which auto-approves Gemini CLI tool calls without human confirmation. The documented execution model states that these tools include file reads, file writes, and command execution. At the same time, `--include-directories` grants the worker read and write access to caller-selected directories. Several examples grant entire project roots, `/tmp`, or `/root`. These permissions are broader than required for common read-only tasks such as summarization, code review, validation, and auditing. The wrapper validates that supplied directories exist, but it does not: - Reject sensitive paths such as `/`, `/root`, or user home directories. - Distinguish read-only input directories from writable output directories. - Restrict writes to a dedicated output path. - Disable shell or mutation tools for analysis-only tasks. - Require confirmation for destructive or security-sensitive operations. - Run the worker in an OS-level sandbox. The command is constructed using a Bash array, so direct shell metacharacter injection through `INCLUDE_DIRS` or the prompt is not evident. The vulnerability instead ar ...[truncated 1765 chars]- Remediation
View remediation
