Back to skill

Security audit

OpenClaw Memory

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but it can automatically read and append shared local agent memory containing sensitive operational details without clear per-use consent.

Review before installing. This skill is useful if you want agents to reuse OpenClaw memory, but install it only where automatic access to remembered hosts, paths, runbooks, preferences, and notes is acceptable. Prefer disabling implicit invocation or requiring explicit confirmation before memory search or append operations, especially on shared or sensitive machines.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

other

Warning
Location
agents/openai.yaml:4
Finding

Implicit Invocation Enables Broad Retrieval of Sensitive Local Agent Memory

Content
View full analysis

Vulnerability Details

File Location: agents/openai.yaml:4-7; related data-access logic in scripts/openclaw_memory.py:75-101 and scripts/openclaw_memory.py:104-149
Vulnerability Type: Sensitive Agent Memory Access
Risk Level: Medium

Vulnerable Code

agents/openai.yaml:4-7:

yaml
default_prompt: "Use $openclaw-memory to check remembered local servers, services, paths, workflow notes, and shared preferences before acting. Search markdown memory first, fall back to SQLite chunk text when needed, and append new durable facts to OpenClaw memory when appropriate."

policy:
  allow_implicit_invocation: true

scripts/openclaw_memory.py:75-101:

python
def search_markdown(query: str, limit: int) -> list[Result]:
    tokens = tokenize(query)
    results: list[Result] = []
    for path in iter_markdown_files():
        try:
            text = path.read_text(encoding="utf-8")
        except OSError:
            continue
        score = score_text(text, tokens)
        if score <= 0:
            continue
        results.append(
            Result(
                path=str(path),
                source="markdown",
                score=score,
                snippet=snippet_for(text, query),
            )
        )
    results.sort(key=lambda item: (-item.score, item.path))
    return results[:limit]

scripts/openclaw_memory.py:104-149:

python
def search_sqlite(query: str, limit: int) -> list[Result]:
    sqlite_db = sqlite_db_path()
    if not sqlite_db.exists():
        return []

    tokens = tokenize(query)
    if not tokens:
        return []

    clauses = " OR ".join(["lower(text) LIKE ?" for _ in tokens])
    params = [f"%{token}%" for token in tokens]
    sql = f"""
        SELECT path, text
        FROM chunks
        WHERE {clauses}
        ORDER BY updated_at DESC
        LIMIT ?
    """

    try:
        
...[truncated 4263 chars]
Remediation
View remediation

Remediation Suggestions

  1. Set allow_implicit_invocation to false so that memory access requires an explicit user request.
  2. Require confirmation before searching memory when the request did not clearly ask for persistent local state.
  3. Introduce separate scopes for preferences, operational notes, infrastructure data, and daily history; search only the scope required by the request.
  4. Redact likely credentials, API keys, private keys, authentication headers, connection strings, and other secrets before generating snippets.
  5. Avoid returning absolute filesystem paths unless they are specifically required by the user.
  6. Add configurable allowlists for memory files and SQLite records that the Skill may inspect.
  7. Limit query breadth and repeated probing to reduce keyword-based enumeration of memory contents.
  8. Log memory-search invocations with the requesting context and selected scope, while ensuring that the audit log itself does not contain sensitive snippets.
  9. Document that memory results may contain sensitive operational data and must not be reproduced outside the authorized user context.
  10. Preserve the current absence of networking behavior; do not add remote telemetry or external search without explicit consent and strict data minimization.
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Resolve the skill directory from this `SKILL.md` file, then use the bundled script at `scripts/openclaw_memory.py`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Resolve the skill directory from this `SKILL.md` file, then use the bundled script at `scripts/openclaw_memory.py`.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill instructs the agent to read from user-scoped files, inspect environment-controlled paths via OPENCLAW_HOME, and append to shared memory files, but it declares no explicit tool scope or permission boundaries. In an agent ecosystem, this creates an over-privileged capability surface where ordinary invocations could trigger local file reads/writes against sensitive or shared state without clear authorization constraints.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The activation description is very broad: it can match many normal requests involving preferences, servers, hosts, services, paths, or prior context, which increases the chance the skill is invoked when not truly needed. Because the skill can search and append shared local memory, over-broad triggering raises the risk of unnecessary access to sensitive local information or unintended persistence of data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill enables implicit invocation without any visible trigger constraints, exclusions, or scoping limits, which can cause it to run automatically in contexts where the user did not explicitly request memory access. Because this skill can inspect and append shared local memory containing servers, internal services, paths, runbooks, and user preferences, unintended invocation increases the risk of over-collection, disclosure of sensitive local context, and persistence of unvetted data.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.