Back to skill

Security audit

OpenClaw Memory Resilience

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for memory durability, but it under-scopes sensitive persistence by recommending credentials in long-lived memory and silent disk writes.

Review carefully before installing. Use the memory and indexing pattern only for non-sensitive notes, preferences, decisions, and references. Do not store plaintext passwords, API keys, private keys, session cookies, or full connection strings in MEMORY.md, TOOLS.md, daily notes, or indexed archives; store only secret-manager names or retrieval procedures. Enable silent memory flushes only where automatic disk persistence is acceptable.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
references/file-architecture.md:19
Finding
Sensitive Credentials Recommended for Persistent Agent Memory and Retrieval Indexing## Vulnerability Details **File Location**: `references/file-architecture.md`, lines 19-25 and 69-79 **Vulnerability Type**: Sensitive data stored in persistent agent context and searchable memory **Risk Level**: Medium ### Vulnerable Code Snippets ```markdown ├── TOOLS.md — Environment: SSH hosts, services, credentials map ``` ```markdown **MEMORY.md** — curated, compact, durable facts. Credentials, infrastructure, decisions, preferences. Updated manually when something important should persist. Keep under 5KB. ``` ```json { "memory": { "backend": "qmd", "qmd": { "includeDefaultMemory": true, "update": { "interval": "5m", "onBoot": true } } } } ``` ### Technical Analysis The Skill explicitly recommends recording credentials in `MEMORY.md` and describes a credentials map in `TOOLS.md`. These bootstrap files are persistently stored and loaded into agent context at session startup. The recommended QMD configuration also enables default-memory indexing. Compaction resilience does not require retaining secret values. Storing credentials in routinely injected or searchable memory violates least-data and least-exposure principles. It expands secret exposure to model context, session processing, retrieval results, workspace backups, and any users or processes capable of reading the workspace. Although the Skill contains no direct exfiltration mechanism, prompt injection or an unauthorized workspace reader could exploit this architecture to discover credentials. ### Attack Path 1. An operator follows the Skill and stores passwords, tokens, private keys, or other credentials in `MEMORY.md` or `TOOLS.md`. 2. The files persist across sessions and may be loaded automatically as bootstrap context. 3. Default memory is indexed by QMD under the recommended configuration. 4. An attacker introduces a malicious prompt through user input or other untrusted content, or gains read access to the workspace. 5. The attac ...[truncated 805 chars]
Remediation
## Remediation Suggestions 1. Replace the recommendation to store credentials with an explicit prohibition against retaining passwords, API tokens, private keys, session cookies, recovery codes, or complete connection strings in agent memory. 2. Store secrets in a dedicated secret manager or operating-system credential store. Memory files should contain only non-sensitive aliases, resource identifiers, or secret-manager reference names. 3. Clarify that a “credentials map” must contain metadata only, such as the secret's logical name and retrieval procedure, never its value. 4. Exclude any potentially sensitive files and directories from QMD indexing rather than relying solely on `includeDefaultMemory: true`. 5. Apply restrictive filesystem permissions and ensure memory files are excluded from public repositories, broad backups, logs, and artifact uploads. 6. Define retention and deletion policies for daily notes and archives. Archival should not be treated as a security boundary. 7. Add secret-detection checks before memory writes and indexing, with redaction or rejection of likely credentials. 8. Apply minimum privileges and rotation policies to any credentials that may already have been stored. Remove them from memory, indexes, transcripts, backups, and archives, then rotate them.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (2)

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation explicitly describes a silent turn that causes the agent to save important context to disk while suppressing any user-visible reply. That creates a transparency and consent problem: users may not realize their conversation-derived data is being persisted, which can lead to inadvertent storage of sensitive information and weaken auditability in environments with privacy or compliance requirements.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The document explicitly lists credentials as appropriate content for MEMORY.md, which is described as a durable bootstrap file reloaded into every session. Persisting secrets in broadly reused memory files increases the chance of accidental exposure through prompt context injection, logs, indexing/search backends, backups, and unauthorized workspace access. In this skill context, the risk is heightened because the entire purpose is to maximize persistence and searchability of agent memory across restarts and compaction.

Static analysis

No suspicious patterns detected.