T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:73- Finding
Overbroad Cross-Session Conversation and Log Collection
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:73-91;references/fallback-session-paths.md:10-21
Vulnerability Type: Excessive access to session histories and operational logs
Risk Level: MediumVulnerable Instructions
SKILL.md:73-91:markdown ## Step 4: Collect Raw Data (Local Only) Use this order: 1. Preferred path with built-in OpenClaw session tools. - List candidate sessions updated in the window (`sessions_list`). - For each relevant session, fetch history with tool messages when available (`sessions_history`). 2. Fallback path from local transcript files when session tools are unavailable. - Read standard paths from `{baseDir}/references/fallback-session-paths.md`. - Parse `sessions.json` index and per-session transcript files (`*.jsonl`) best effort. - If fallback paths are inaccessible, continue with available data and document the limitation. 3. Optional supplemental source when available. - If local gateway logs are present and readable, extract only UX-relevant operational signals (errors, retries, permission denials, tool failures) into the same normalized stream. - Treat gateway logs as optional; do not fail the run when missing. Normalize records into an event stream with: - `event_id`references/fallback-session-paths.md:10-21:markdown ## Common Session Storage Layout - `<stateDir>/agents/<agentId>/sessions/sessions.json` - `<stateDir>/agents/<agentId>/sessions/*.jsonl` `sessions.json` is typically an index. `*.jsonl` files typically contain event history. ## Discovery Strategy 1. If current session metadata includes `agentId`, use that exact path first. 2. If `scope=all_agent_sessions` and `agentId` is unknown, enumerate `<stateDir>/agents/*/sessions/`. 3. Filter sessions by `updatedAt` (or nearest equivalent timestamp) to match the requested window. 4. P ...[truncated 3538 chars]- Remediation
View remediation
Remediation Suggestions
- Make
this_session_onlythe mandatory default scope andminimalthe default capture level. - Require fresh, explicit confirmation immediately before every
all_agent_sessionsorfullcapture run; do not rely only on previously stored consent. - Present the exact session IDs, data sources, time window, capture level, and estimated record volume before collection begins.
- Require users to select specific session IDs instead of enumerating
agents/*/sessions/by default. - Disable gateway-log collection by default and require separate consent because logs may include unrelated operational data.
- Collect aggregate event labels and counters whenever raw message text is unnecessary. Avoid persisting tool outputs in minimal and snippet modes.
- Apply restrictive filesystem permissions to
state.json,data/, andreports/, such as owner-only access where supported. - Validate that all resolved fallback paths remain beneath the expected OpenClaw state directory, reject symlinks that escape the approved root, and preserve the existing traversal and shell-metacharacter checks.
- Add post-redaction validation that blocks persistence when likely secrets or high-risk data remain, rather than relying solely on a fixed pattern list.
- Show a post-run inventory of all files created and provide an immediate purge option.
- Store only pseudonymous session identifiers and use a keyed local hash if identifiers must remain stable across reports.
- Minimize retention for full-text capture and consider deleting raw events immediately after aggregate reports are generated.
- Make
