Back to skill

Security audit

session-handover

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local handover-note workflow whose sensitive session reads and durable notes are disclosed and aligned with its purpose.

Install only if you want agents to summarize local session and workspace state for continuity. When invoking it, give a clear task/session scope and review the handover note for secrets or unrelated private details before relying on it across sessions.

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:39
Finding

Overbroad Collection of Sensitive Session and Agent Memory Data

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 39–42; related processing instructions at lines 65–73 and 107–109
Vulnerability Type: T05: Unauthorized Access and Privilege Escalation
Risk Level: Medium

Vulnerable Code Snippet

markdown
## Inputs

- Session directory: `~/.openclaw/agents/<agentId>/sessions/`
- Optional index: `sessions.json`
- Memory files in the workspace (`memory/*.md`; `MEMORY.md` only where allowed)
- Current plans, blackboards, receipts, service state, git state, and task artefacts when relevant

Related instructions expand the collection to session messages and operational state:

markdown
1. **Inventory the station**
   - List relevant sessions and artefacts by date/size.
   - Read current plans, blackboards, locks, service state, and receipts when the task used them.
   - Resolve which work is complete, active, abandoned, or blocked.

2. **Extract user intent and constraints first**
   - Read authenticated user messages before assistant/tool output.
   - Preserve the newest applicable decision.
   - Render exact protected targets as `DO_NOT_TOUCH: <target>`.

The supplied command examples directly parse user messages from session transcripts:

bash
ls -lt ~/.openclaw/agents/main/sessions/*.jsonl
jq -r 'select(.message.role=="user") | .message.content[]? | select(.type=="text") | .text' <session>.jsonl
jq -r '.message.content[]? | select(.type=="toolCall") | .name' <session>.jsonl | sort | uniq -c | sort -rn

Technical Analysis

The Skill instructs an agent to enumerate and inspect session transcripts, persistent memory, plans, blackboards, service state, locks, receipts, and authenticated user messages. These resources can contain private conversations, credentials, internal paths, protected operational details, or information unrelated to the handover task.

The stated handover purpose provides a le ...[truncated 2369 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require explicit user authorization before reading historical session transcripts, persistent memory, or service-state artifacts.
  2. Constrain collection to a specified Agent ID, current task, approved session list, and bounded time range.
  3. Default to metadata, known receipt paths, and user-selected artifacts instead of scanning complete transcripts.
  4. Add a pre-ingestion filter that excludes credentials, tokens, private keys, unrelated messages, and data outside the active task.
  5. Apply data minimization before content enters model context; post-collection redaction alone is insufficient.
  6. Require confirmation before writing or updating durable memory, blackboards, or SESSION_NOTES.md.
  7. Define access controls, retention periods, expiration behavior, and secure deletion procedures for generated handover notes.
  8. Record an audit receipt listing which source files were accessed and which destination was written, without recording sensitive contents.
  9. Add an explicit prohibition against reading sessions belonging to other users, agents, or tasks unless separately authorized.
  10. Preserve the existing security-redaction requirement, but supplement it with deterministic secret scanning and a final review before persistence.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (2)

Session Persistence

Medium
Category
Rogue Agent
Confidence
83% confidence
Finding

The skill explicitly instructs the agent to persist session information into durable notes and memory artifacts, creating a risk of retaining sensitive user data, secrets, protected targets, or operational context beyond the original session. Although the skill tells the agent to redact secrets, it also directs broad collection from session logs, memory files, plans, receipts, and service state, so over-collection or accidental persistence is plausible.

Content

Scanner excerpt · SKILL.md (reported line 48)May include surrounding context.

md
## Recommended output

Write or update the appropriate durable handover note, normally `SESSION_NOTES.md`, a daily memory entry, or the active typed blackboard.

Use this compact shift sheet:

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SKILL.md (reported line 102)May include surrounding context.

md
- Expire or remove stale notes rather than letting old state masquerade as current state.

8. **Read it as the incoming shift**
   - Confirm a fresh model can continue safely without asking what happened.
   - Confirm it cannot mistake reserved work for free stock or completed work for outstanding work.

## Useful command snippets