Back to skill

Security audit

Session Recall

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says by searching old OpenClaw conversations, but it can search all agents' transcript history by default and exposes sensitive snippets and file paths without clear authorization controls.

Install only if you are comfortable with agents searching local OpenClaw transcript history. Prefer using --agent for the current agent and narrow --start windows; avoid all-agent searches unless you intentionally want cross-agent recall and understand that old conversations may contain secrets or private context.

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

Error
Location
scripts/session-recall.py:252
Finding

Cross-Agent Session Transcripts Are Accessible Without Authorization

Content
View full analysis

Vulnerability Details

File Location: scripts/session-recall.py:93-126, scripts/session-recall.py:209-216, and scripts/session-recall.py:252-260
Vulnerability Type: Missing authorization and violation of least privilege
Risk Level: High

Vulnerable Code

python
def discover_agents() -> list[str]:
    """List all agent directories that have a sessions/ subdirectory."""
    if not SESSIONS_BASE.is_dir():
        return []
    return sorted(
        d.name
        for d in SESSIONS_BASE.iterdir()
        if d.is_dir() and (d / "sessions").is_dir()
    )


def get_session_files(
    agent: str,
    start_ts: float | None = None,
    end_ts: float | None = None,
) -> list[Path]:
    """Get session JSONL files for an agent, sorted by mtime descending.

    Filters by file mtime:
      - start_ts: only files modified at or after this time
      - end_ts: only files modified at or before this time
    """
    sessions_dir = SESSIONS_BASE / agent / "sessions"
    if not sessions_dir.is_dir():
        return []
    files = sorted(
        sessions_dir.glob("*.jsonl"),
        key=lambda f: f.stat().st_mtime,
        reverse=True,
    )
python
def cmd_list(args):
    """List sessions with previews."""
    agents = [args.agent] if args.agent else discover_agents()
    start_ts = parse_time(args.start) if args.start else None
    end_ts = parse_time(args.end) if args.end else None
    limit = args.limit or 20
    offset = args.offset or 0
    results = []

    for agent in agents:
        files = get_session_files(agent, start_ts, end_ts)
python
def cmd_search(args):
    """Search session transcripts for a query string."""
    query = args.query.lower()
    agents = [args.agent] if args.agent else discover_agents()
    start_ts = parse_time(args.start) if args.start else None
    end_ts = parse_time(args.end) if args.end else None
    limit = args.limit or 30
    offset = args.offset or 0
    results = []

    for agent in a
...[truncated 2595 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require the runtime to provide a trusted current-agent identifier rather than accepting identity solely from user-controlled command-line input.
  2. Default both list and search to the authenticated current agent. Never interpret an omitted --agent option as permission to search all agents.
  3. Reject requests for a different agent unless an explicit, independently validated authorization grant permits cross-agent access.
  4. Separate administrative enumeration from normal recall operations. The agents command and all-agent searching should be disabled for ordinary agents or protected by a dedicated administrative capability.
  5. Resolve the selected session directory to a canonical path and verify that it remains beneath the authorized agent's canonical sessions directory before opening files.
  6. Return opaque session identifiers instead of unrestricted absolute paths where possible, and mediate subsequent reads through the same authorization layer.
  7. Minimize transcript disclosure by redacting likely secrets and limiting previews and snippets to the smallest context needed.
  8. Add tests confirming that omitted --agent searches only the current agent and that attempts to select another agent fail without explicit authorization.
  9. Update README.md and SKILL.md so their documented access model exactly matches the enforced behavior.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README explicitly promotes searching past transcripts and notes support for searching other agents' sessions, but it does not describe any consent, authorization, or data-minimization boundaries. In this skill context, that omission is dangerous because the feature directly exposes prior conversation history on disk, potentially including sensitive user data, secrets, or cross-agent conversations to the current agent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The agent-facing instructions tell AI agents to inspect session identifiers and use transcript search as part of normal operation, but omit that these actions touch sensitive local conversation history. Because this skill is specifically designed to recover memory from stored transcripts, failing to warn about privacy and authorization materially increases the chance of inappropriate access or disclosure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The automatic activation condition is broad enough that an agent may search historical transcripts whenever a user merely implies prior context, without clear checks for necessity, scope, or authorization. In a memory-recovery skill, overbroad triggering increases the chance of unnecessary transcript access and privacy leakage, especially if multiple agents' sessions are searchable.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill instructs the agent to search transcript files and then read relevant lines, which is file-read capability handling potentially sensitive prior-conversation data. Because the manifest declares no explicit tool scope or permissions boundary, the skill's effective access is under-specified, increasing the risk of over-broad file access or accidental use beyond the intended session-history corpus.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill is specifically designed to search and read past session transcripts, yet the user-facing description does not warn that prior conversation contents and file paths may be accessed and surfaced. This creates a privacy and transparency issue: users may not realize historical data is being searched, which can expose sensitive context from earlier sessions unexpectedly.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.