T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
SKILL.md:8- Finding
Insufficiently Gated Access to Historical Sessions and Raw Transcript Storage
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 8–18 and 40–56
Vulnerability Type:T05: Unauthorized Access and Privilege Escalation
Risk Level: MediumEvidence
markdown ## Preferred workflow 1. For exact words or phrases, call `sessions_search`. 2. For recent, parent, child, labeled, or active sessions, call `sessions_list`. 3. Open the selected session with `sessions_history` using its returned `sessionKey`. 4. Start bounded: - omit `includeTools` unless tool calls/results matter - use a small `limit` for the newest tail - use `offset: 0`, then returned `nextOffset`, only when paging older history - use a returned message anchor when the tool exposes one 5. Report the observed session/model/timestamp and quote only the needed excerpt. If these tools are deferred, load their exact schemas before calling them.markdown ## Current storage model Canonical runtime session and transcript rows live in the per-agent SQLite database: `~/.openclaw/agents/<agentId>/agent/openclaw-agent.sqlite` Do not treat legacy `sessions.json` or session JSONL files as the current source of truth. Files under `~/.openclaw/agents/<agentId>/sessions/` are archived/migration artifacts unless an explicit export created them. For operator diagnostics, prefer supported read-only commands such as: `openclaw doctor --session-sqlite inspect --session-sqlite-agent <agentId> --json` Use `openclaw sessions --agent <agentId> --json` when agent tools are unavailable and only session listing is needed. ## Raw and archived evidence Do not describe `sessions_history` as an exact raw dump. If sanitized history is insufficient, state the limitation. Inspect raw SQLite transcript rows or explicit exports only for a justified forensic/debugging task with appropriate local access; keep reads scoped and read-only.Technical Analysis
The skill instructs a ...[truncated 2595 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit user confirmation before searching or opening historical sessions, including identification of the intended agent, session, and time range.
- Enforce ownership and visibility authorization in the session tools rather than relying exclusively on skill instructions.
- Restrict searches to the current user's sessions and deny cross-agent access by default.
- Disable direct SQLite and export inspection in normal skill operation. Move raw forensic access into a separate privileged workflow requiring renewed confirmation and a documented justification.
- Prefer sanitized APIs and fail closed when they omit or redact data; omission should not automatically authorize access to raw storage.
- Apply secret detection and redaction before historical content is returned to the current conversation.
- Minimize retrieved and quoted content through strict limits, narrow date ranges, and message-level selection.
- Record auditable events for session enumeration, transcript access, export access, and raw database inspection.
- Ensure transcript databases and exports have restrictive filesystem permissions and are inaccessible to unrelated agents or operating-system users.
- Document retention and deletion controls so historical transcripts do not remain available longer than operationally necessary.
