T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:29- Finding
Unrestricted Access to Complete Historical Session Logs
- Content
View full analysis
/sessions/` (default: `~/.openclaw/agents//sessions/`). Use the `agent=` value from the system prompt Runtime line. - **`sessions.json`** - Index mapping session keys to session IDs - **`.jsonl`** - Full conversation transcript per session ``` The Skill also provides an unrestricted cross-session search operation: ```markdown ### Search across ALL sessions for a phrase ```bash AGENT_ID="" SESSION_DIR="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/agents/$AGENT_ID/sessions" rg -l "phrase" "$SESSION_DIR"/*.jsonl ``` ``` ### Technical Analysis The Skill discloses the location and structure of the Agent's complete historical session storage and instructs the Agent to enumerate, search, and extract data from all session transcript files. These transcripts may contain user messages, assistant responses, tool calls, usage information, personal data, confidential business information, or credentials previously supplied during unrelated conversations. The documented operations are read-only and do not exploit an operating-system vulnerability. However, the Skill does not establish authorization or least-privilege controls before accessing unrelated sessions. It lacks: - Verification that the requesting user owns the target session. - Restriction to a specified session or authorized parent-session chain. - Explicit consent before searching complete conversation history. - Separation between providers, users, or conversation contexts. - Filtering of tool calls, internal reasoning records, credentials, or other sensitive content. - Redaction and output-volume controls before matchi ...[truncated 1599 chars]- Remediation
View remediation
" SESSION_FILE="$SESSION_DIR/$SESSION_ID.jsonl" test -f "$SESSION_FILE" && jq -r ' select(.type == "message" and .message.role == "user") | .message.content[]? | select(.type == "text") | .text ' "$SESSION_FILE" | rg --fixed-strings -- "$QUERY" ``` 10. Treat query input strictly as data by using fixed-string matching and `--` argument separation, and validate session identifiers before incorporating them into file paths. ]]>
