Back to skill

Security audit

open-memory-system

Security checks for vulnerabilities and agentic risk

Overview

This is a real persistent memory skill, but it installs automatic hooks and scheduled tasks and contains unsafe file-writing and code-execution paths that need review before use.

Install only if you intentionally want persistent cross-session OpenClaw memory. Review and restrict the hook and cron setup, keep MEMORY_DIR in a private least-privilege location, inspect stored memory regularly, and fix the filename validation and cleanup index.py execution issue before relying on it in a shared or sensitive workspace.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/memory.py:64
Finding

Path Traversal Enables Arbitrary Markdown File Overwrite

Content
View full analysis
Remediation
View remediation
Path: if not identifier or Path(identifier).is_absolute(): raise ValueError("Invalid identifier") if identifier in {".", ".."} or "/" in identifier or "\\" in identifier: raise ValueError("Path separators are not allowed") base = base_dir.resolve() destination = (base / f"{identifier}.md").resolve() try: destination.relative_to(base) except ValueError as exc: raise ValueError("Destination escapes the memory directory") from exc return destination ``` 3. Use generated identifiers, such as UUIDs or hashes, for filenames and store user-supplied labels only inside file content. 4. Apply a conservative allowlist, such as letters, numbers, spaces, underscores, and hyphens, with a strict maximum length. 5. Use non-destructive creation where overwriting is not required, or explicitly confirm that an existing target is an expected managed file. 6. Add automated tests covering `../`, absolute paths, repeated traversal, backslash-based traversal, empty names, oversized names, and symbolic-link edge cases. 7. Run the Skill under a dedicated least-privileged account with write access limited to the memory directory. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/memory.py:240
Finding

Executable Python File Is Loaded from a Writable Memory Data Directory

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The documented behavior overstates automation and understates additional memory categories such as agent persona and episodic storage. This mismatch is security-relevant because operators may enable the skill believing it only stores limited user memory, while it also introduces broader persistence and automation surfaces that affect privacy, retention, and trust boundaries.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/distill_l2.py (reported line 130)May include surrounding context.

python
description
    ]
    
    env = dict(os.environ)
    env["MEMORY_DIR"] = str(MEMORY_DIR)
    
    result = subprocess.run(

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README advertises automatic capture and persistence of user preferences, entities, events, and session learnings, but does not warn users about retention scope, sensitivity of stored content, or privacy implications. In a memory-management skill, silent persistence of potentially sensitive cross-session data can lead to unintentional collection and long-term exposure of personal or confidential information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The installation instructions tell users to deploy hooks and note that a startup hook is already preinstalled, which implies automatic execution and file access on session start/end without a clear warning. This is risky because hooks can read and write memory data automatically, expanding the attack surface and causing users to enable persistent behavior they may not fully understand.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This duplicated finding points to the same persistent storage setup that enables accumulation of user and agent memory across sessions. Without clear safeguards, persistent memory can expose sensitive history, preferences, and internal agent state to unintended reuse, leakage, or overcollection.

Content

Scanner excerpt · README.md (reported line 26)May include surrounding context.

load-memory-on-start 已在 ~/.openclaw/hooks/ 中预装,无需重复部署

3. 初始化记忆目录

mkdir -p ~/.openclaw/workspace/memory/{user/{preferences,entities,events},agent/{persona,episodic},short-term}

4. 创建 Cron(参考 crons/memory-crons.txt)

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This duplicated finding points to the same persistent storage setup that enables accumulation of user and agent memory across sessions. Without clear safeguards, persistent memory can expose sensitive history, preferences, and internal agent state to unintended reuse, leakage, or overcollection.

Content

Scanner excerpt · README.md (reported line 26)May include surrounding context.

load-memory-on-start 已在 ~/.openclaw/hooks/ 中预装,无需重复部署

3. 初始化记忆目录

mkdir -p ~/.openclaw/workspace/memory/{user/{preferences,entities,events},agent/{persona,episodic},short-term}

4. 创建 Cron(参考 crons/memory-crons.txt)

text

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documents shell commands, environment-variable use, and filesystem read/write behavior, but declares no tool scope or permission boundary. That creates an authorization ambiguity where a host may expose broader capabilities than users expect, increasing the chance of unintended file modification or data access during installation and operation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises persistent cross-session memory of user preferences, entities, and events without warning users that conversation-derived information may be retained. In a memory skill, that omission is especially dangerous because the core function is storing potentially sensitive personal or operational data, which can later be surfaced, misused, or leaked.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The plain-language description indicates long-term persistence of dialogue-derived knowledge across sessions, which creates an inherent data retention and disclosure risk. In this context, the danger is elevated because memory contents can accumulate sensitive personal preferences, project details, and operational history that may later be retrieved outside the user's expectations.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

The skill sets up persistent on-disk session and long-term memory directories, including user and agent memory categories, which introduces cross-session retention by design. While persistence is central to the skill's purpose, it remains a security and privacy risk because retained data can be accessed later by other tools, users, or processes if not tightly governed.

Content

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

bash
export MEMORY_DIR=~/.openclaw/workspace/memory
mkdir -p $MEMORY_DIR/{user/{preferences,entities,events},agent/{persona,episodic},short-term}

Step 3: 部署 Hook

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The installation instructions enable hooks and cron jobs that automate saving and processing session data, but do not warn the operator that this changes the system from manual note-taking into continuous persistence. That increases the likelihood of silent retention of sensitive material and makes accidental over-collection more likely.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow explicitly says learned session content is automatically saved into memory at session end, which can capture sensitive or regulated information without contextual review. Because this occurs automatically via hooks, users may not realize what has been retained, and the data may persist into later sessions or be distilled into longer-term stores.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest description and the user-facing instructional content are written entirely in Chinese, with no indication that the skill supports other languages or that the language restriction is region-specific. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The hook automatically copies content from the workspace .learnings directory into persistent memory at session end without any user-facing notice, consent, or approval step. In a memory-management skill, this is especially risky because the copied markdown may contain sensitive user data, secrets, or transient notes that the user did not intend to retain across sessions, creating a privacy and data-retention issue.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/distill_l2.py (reported line 133)May include surrounding context.

python
env = dict(os.environ)
    env["MEMORY_DIR"] = str(MEMORY_DIR)
    
    result = subprocess.run(
        cmd,
        capture_output=True,
        text=True,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

User-facing strings, help text, comments, and status messages are predominantly in Chinese, and the skill does not provide any option to select another language or explicitly document a justified locale restriction. This can violate a language/locale policy when users are not given an opt-in choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill persistently stores user-provided content, metadata, preferences, entities, and events to disk with no user-facing consent, retention notice, or minimization controls. In a memory system, this context makes the issue more sensitive because users may disclose personal or confidential information that is silently retained across sessions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

A memory-management utility is expected to read/write memory artifacts, not spawn additional executables. That extra execution surface materially increases risk because cleanup can trigger code execution through index.py, making the skill more dangerous than its stated purpose suggests.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Subprocess execution is not clearly necessary for core memory storage behavior, so it broadens the attack surface without strong justification. In the context of a persistence skill that stores attacker-controlled content on disk, any execution primitive deserves elevated concern.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
94% confidence
Finding

The cleanup path launches an external Python interpreter on a file derived from MEMORY_DIR, which is attacker-influenced via an environment variable. Even though shell injection is avoided by passing an argument list, this still creates arbitrary code-execution risk if an attacker can point MEMORY_DIR to a directory containing a malicious index.py.

Content

Scanner excerpt · scripts/memory.py (reported line 260)May include surrounding context.

python
# 更新索引
        try:
            import subprocess
            subprocess.run(["python3", str(MEMORY_DIR / "index.py")], capture_output=True)
        except:
            pass

Tainted flow: 'MEMORY_DIR' from os.environ.get (line 16, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
97% confidence
Finding

MEMORY_DIR is sourced from os.environ and later used to construct the path passed to python3 for execution. In environments where users, wrappers, or other components can influence environment variables or workspace contents, this enables running arbitrary attacker-supplied Python code during cleanup.

Content

Scanner excerpt · scripts/memory.py (reported line 260)May include surrounding context.

python
# 更新索引
        try:
            import subprocess
            subprocess.run(["python3", str(MEMORY_DIR / "index.py")], capture_output=True)
        except:
            pass

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
74% confidence
Finding

The natural-language documentation is entirely in Chinese and does not indicate that other languages are supported or that this locale choice is optional. Under the stated policy, forcing a specific language without user opt-in can be a language or locale policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

Line L03 mixes an English heading with Chinese-only descriptive text, indicating the skill documentation is written in a specific language without offering a user choice or documenting a locale-specific requirement. This matches the policy concern for language/locale constraints expressed in natural language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file-level description mixes English with Chinese and states the behavior only in Chinese, which imposes a specific language choice in the skill's natural-language documentation without offering user choice. This can violate language or locale policy when the skill does not explicitly provide opt-in or multilingual support.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language docstrings and console messages entirely in Chinese, describing the script's behavior and outcomes without indicating any user-selectable locale. Under the policy rule for language/locale, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.