Back to skill

Security audit

session-logs

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed helper for finding prior OpenClaw session history, with sensitive transcript access that is purpose-aligned and bounded read-only.

Install only if you want agents to help locate and quote prior OpenClaw session content. Treat results as sensitive: ask for narrow searches, avoid broad transcript review unless needed, and reserve raw SQLite inspection for explicit debugging or forensic work.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

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: Medium

Evidence

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

  1. Require explicit user confirmation before searching or opening historical sessions, including identification of the intended agent, session, and time range.
  2. Enforce ownership and visibility authorization in the session tools rather than relying exclusively on skill instructions.
  3. Restrict searches to the current user's sessions and deny cross-agent access by default.
  4. 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.
  5. Prefer sanitized APIs and fail closed when they omit or redact data; omission should not automatically authorize access to raw storage.
  6. Apply secret detection and redaction before historical content is returned to the current conversation.
  7. Minimize retrieved and quoted content through strict limits, narrow date ranges, and message-level selection.
  8. Record auditable events for session enumeration, transcript access, export access, and raw database inspection.
  9. Ensure transcript databases and exports have restrictive filesystem permissions and are inaccessible to unrelated agents or operating-system users.
  10. Document retention and deletion controls so historical transcripts do not remain available longer than operationally necessary.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep