Back to skill

Security audit

Claw History

Security checks for vulnerabilities and agentic risk

Overview

The skill is transparent about building a full agent history, but it asks the agent to read broad persistent memories, session histories, sub-agent records, and command logs without enough privacy controls.

Review before installing if your sessions or commands may contain secrets, private paths, customer data, credentials, or unrelated work. Use it only where full local history access is acceptable, and consider enabling logging only with clear retention and deletion practices.

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 (2)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:13
Finding
Overbroad Access to Persistent Memory and Cross-Session History## Vulnerability Details **File Location**: `SKILL.md`, lines 13–18 **Vulnerability Type**: `T05: Unauthorized Access and Privilege Escalation` **Risk Level**: Medium **Vulnerable Code Snippet**: ```markdown ## Required Data Sources (in this order) 1. Earliest and recent `memory/YYYY-MM-DD*.md` files (find first/last dates). 2. `MEMORY.md` for long-term milestones. 3. Available session inventory/history (main + sub-agent sessions when accessible). 4. Current conversation/tool logs. ``` ### Technical Analysis The skill instructs the agent to collect information from persistent memory files, long-term memory, main and sub-agent session histories, and conversation and tool logs. These sources can contain private conversations, credentials included in commands, internal filesystem paths, personal information, or records unrelated to the requesting user or current task. Although this access is directly related to constructing a lifetime history, the instructions do not establish least-privilege boundaries. They do not require explicit authorization for cross-session or sub-agent access, limit collection to a user-selected date range, distinguish records belonging to different users, or require sensitive-data redaction before disclosure. This creates an authorization and privacy-boundary risk when the runtime makes these sources accessible to the skill. ### Attack Path 1. A user invokes the skill by requesting a complete lifetime history. 2. The skill instructs the agent to search persistent memory files and `MEMORY.md`. 3. The agent accesses available main-session and sub-agent histories. 4. The agent examines current conversation and tool logs. 5. Information from these sources is consolidated into a single chronological response. 6. Sensitive or unrelated historical information may be disclosed if the sources contain credentials, private conversations, personal data, or records associated with another context. Exploitation depends on the runtime granting ...[truncated 510 chars]
Remediation
## Remediation Suggestions 1. Default to current-session history and require explicit user confirmation before accessing persistent memory, prior sessions, or sub-agent records. 2. Ask the user to select the desired date range, sessions, and data-source categories. 3. Verify that requested records belong to the authorized user and context before reading or disclosing them. 4. Apply secret and personal-data redaction to command arguments, tokens, passwords, private keys, environment variables, and unrelated conversation content. 5. Summarize sensitive operational records rather than reproducing their raw contents. 6. Require separate authorization before accessing sub-agent histories. 7. Document the exact sources accessed and identify records omitted for privacy or authorization reasons. 8. Add a rule prohibiting disclosure of credentials or unrelated third-party information even when such content appears in an authorized history source.

other

Warning
Location
README.md:12
Finding
Persistent Command Logging Recommended Without Data-Protection Controls## Vulnerability Details **File Location**: `README.md`, lines 12–22 **Vulnerability Type**: `other: Excessive Sensitive Activity Logging` **Risk Level**: Medium **Vulnerable Code Snippet**: ```markdown - **`session-memory`** (recommended): saves session context on `/new` into `workspace/memory/...` - **`command-logger`** (strongly recommended): writes command events to `~/.openclaw/logs/commands.log` - **`boot-md`** (optional): startup automation; not required for timeline reconstruction ## Enable recommended hooks ```bash openclaw hooks enable session-memory openclaw hooks enable command-logger ``` ``` ### Technical Analysis The documentation strongly recommends enabling a persistent command-logging hook and provides the command needed to activate it. Command events may include access tokens, passwords, API keys, private paths, database connection details, personal information, or sensitive command arguments. The project does not document redaction, restrictive file permissions, retention limits, rotation, deletion, encryption, or consent requirements for `~/.openclaw/logs/commands.log`. It similarly recommends session-memory storage without describing safeguards for retained session content. This does not demonstrate malicious persistence: the hooks are openly documented, and no hidden installation or execution logic exists in the audited files. The risk instead arises from retaining potentially sensitive operational data without corresponding data-protection guidance. ### Attack Path 1. A user follows the README and enables `session-memory` and `command-logger`. 2. Subsequent session context and command events are written to persistent local files. 3. Commands or session records containing secrets or private information are retained. 4. The history skill, another local process, or a user with access to the account reads those records. 5. Sensitive content is disclosed through a generated history or direct inspection of the log files. The attack r ...[truncated 567 chars]
Remediation
## Remediation Suggestions 1. Make command and session logging explicitly opt-in rather than strongly recommended. 2. Display a privacy warning before activation explaining that commands and session context may contain sensitive data. 3. Redact passwords, tokens, API keys, authorization headers, private keys, connection strings, and secret-like command arguments before writing records. 4. Log command names and coarse metadata by default instead of complete arguments or raw session content. 5. Create log files with owner-only permissions and verify that parent directories are not accessible to other users. 6. Define retention periods, rotation limits, and secure deletion procedures. 7. Provide commands for disabling the hooks and deleting previously collected records. 8. Document whether logs are encrypted, whether they leave the local system, and which components can access them. 9. Require the history skill to sanitize retained records again before presenting them to a user.
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

Static analysis

No suspicious patterns detected.