Back to skill

Security audit

Memory Maintenance 2.0.0

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed memory/task automation tool, but it asks for broad persistent memory, background scheduling, and generic task execution without enough controls.

Review carefully before installing. Only use this in a workspace where persistent memory is intended, avoid entering secrets or private data, do not enable the background or cron scheduler unless you understand and can remove it, and inspect memory/failure.log and daily memory files regularly for sensitive retained content.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T02 · Agent Memory Poisoning

Error
Location
src/execute_task.py:1118
Finding

Persistent Memory Poisoning Through Unsanitized Task Content

Content
View full analysis

Vulnerability Details

File Location: src/execute_task.py:1118-1153
Vulnerability Type: Persistent injection of attacker-controlled content into Agent memory
Risk Level: High

Vulnerable Code

python
def _generate_memory_entry(self, task: str, result: Dict) -> str:
    """Generate a memory entry."""
    timestamp = datetime.now().strftime("%Y-%m-%d %H:%M")
    task_name = result.get("task", task)
    
    entry = f"""---
## {task}

**Time**: {timestamp}

**Description**: {task_name}

**Execution status**: {result.get("status", "unknown")}

**Key information**:
- Method: {result.get("method", "unknown")}
- Duration: {result.get("duration", "N/A")}
- Resources: {result.get("resources", [])}

**Memory content**:
{result.get("memory_content", "")}

---
"""
    return entry

def _save_memory_entry(self, task: str, result: Dict) -> str:
    """Save the memory entry to a file."""
    path = os.path.join(MEMORY_PATH)
    timestamp = datetime.now().strftime("%Y-%m-%d")
    filename = f"{timestamp}.md"
    filepath = os.path.join(Memory_Daily_DIR, filename)
    
    with open(filepath, 'a', encoding='utf-8') as f:
        f.write(f"\n## Memory maintenance record\n\n{result.get('memory_entry', '')}")
    
    return filepath

Technical Analysis

The task text, result task value, and memory_content value are directly interpolated into a Markdown memory entry. The resulting entry is appended to persistent daily memory without validation, escaping, provenance metadata, or separation between trusted instructions and untrusted task data.

Markdown memory files are likely to be supplied to an Agent as contextual state in later sessions. Consequently, an attacker can submit content that resembles operational instructions, security exceptions, tool-use directives, or fabricated user preferences. When later loaded as memory, that content may be interpreted as trusted conte ...[truncated 1368 chars]

Remediation
View remediation

Remediation Suggestions

  1. Store task data in a structured format such as JSON rather than executable or instruction-like Markdown.
  2. Attach explicit provenance fields, including source, timestamp, trust level, and whether the content was user-supplied.
  3. Escape Markdown headings, delimiters, links, and other control syntax before persistence.
  4. Reject or quarantine content that resembles system instructions, tool directives, authorization changes, or requests to override prior rules.
  5. Ensure memory consumers treat persisted task text strictly as quoted data, never as instructions.
  6. Require explicit user confirmation before promoting any generated entry to permanent memory.
  7. Apply length limits and an allowlist schema to task, memory_content, and other persisted fields.
  8. Keep untrusted task history physically separate from trusted preferences and permanent configuration.

T06 · System Persistence

Warning
Location
SKILL.md:909
Finding

Cross-Session Persistence Through Background and Cron Scheduler Instructions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:909-912
Vulnerability Type: Persistent scheduled execution
Risk Level: Medium

Vulnerable Code

bash
python memory_maintenance_scheduler.py &

0 20 * * * /Users/l18/.openclaw/workspace/memory_maintenance_scheduler.py

Technical Analysis

The usage documentation instructs users to start a maintenance scheduler as a background process or register it as a cron job. Either mechanism allows execution to continue beyond the initiating Skill session. The documented scheduler performs recurring memory review, promotion, deletion, and permanent-memory auditing.

The repository does not silently install the cron entry, and the referenced scheduler is presented in documentation rather than included as a separate executable file. Exploitation therefore requires a user or deployment process to follow the documented automation instructions. Nevertheless, the requested configuration creates cross-session persistence with the permissions of the user who installs it.

The cron example also uses a fixed user-specific path and provides no integrity verification, restricted execution environment, locking, audit policy, or uninstall procedure.

Attack Path

  1. A user follows the automation instructions in SKILL.md.
  2. The scheduler is launched in the background or added to the user's crontab.
  3. The process continues running after the original Skill invocation ends, or cron launches it repeatedly.
  4. Scheduled code receives recurring access to the workspace and memory files.
  5. If the script or referenced workspace is later modified, the modified code is executed automatically at the next scheduled interval.

Impact Assessment

Scheduled execution runs with the privileges of the account that created the cron entry. It can repeatedly read, modify, promote, or delete files that the account can access, including Agent memory.

No evidence shows installation ...[truncated 190 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove generic background-process and direct crontab installation instructions.
  2. Prefer explicit user-triggered maintenance or a platform-managed scheduler with clear consent and revocation controls.
  3. If scheduling is essential, use a verified absolute path owned by the expected user and reject writable or untrusted script locations.
  4. Run the scheduler under a dedicated least-privileged account with access only to the required memory directory.
  5. Provide a documented uninstall procedure that stops the process and removes the cron entry.
  6. Add file-integrity validation, execution locking, bounded runtime, restricted environment variables, and security logging.
  7. Require confirmation before memory deletion or promotion, even during scheduled maintenance.
  8. Disclose clearly that enabling automation creates execution that survives the current Skill session.

T09 · Insecure Skill Coding Practices

Warning
Location
src/execute_task.py:1158
Finding

Unredacted Sensitive Data and Tracebacks Written to Persistent Plaintext Logs

Content
View full analysis

Vulnerability Details

File Location: src/execute_task.py:1158-1173
Vulnerability Type: Insecure plaintext logging and excessive sensitive-data retention
Risk Level: Medium

Vulnerable Code

python
def _log_failure(self, task: str, result: Dict, reason: str = "Execution failed"):
    """Record a failure log."""
    log_entry = {
        "task": task,
        "timestamp": datetime.now().isoformat(),
        "status": result.get("status", "unknown"),
        "reason": result.get("reason", reason),
        "error": result.get("error", ""),
        "traceback": result.get("traceback", ""),
        "attempt": result.get("attempt", 1),
        "retried": result.get("retried", False),
        "suggestion": self._generate_suggestion(task, result)
    }
    
    log_file = os.path.join(WORKSPACE, "memory", "failure.log")
    with open(log_file, 'a', encoding='utf-8') as f:
        f.write(f"\n### {task}\n{json.dumps(log_entry, ensure_ascii=False, indent=2)}\n---\n")

Technical Analysis

The failure logger writes complete task descriptions, exception messages, and stack traces to a predictable plaintext file. These fields can contain API tokens, credentials, private prompts, filesystem paths, environment details, or sensitive user data.

The file is opened using default process permissions. The implementation does not explicitly create it with owner-only access, redact secrets, encrypt sensitive fields, impose a size limit, or enforce retention. The related cleanup_failed_tasks() method at src/execute_task.py:1196-1198 is unimplemented, so the code provides no effective cleanup mechanism.

Stack traces also expose internal file paths and implementation details that can help an attacker map the environment.

Attack Path

  1. A user submits a task containing sensitive information, or an operation fails with a secret embedded in its error message.
  2. The exception handler places ...[truncated 739 chars]
Remediation
View remediation

Remediation Suggestions

  1. Redact common secret formats, including API keys, bearer tokens, passwords, cookies, private keys, and authorization headers.
  2. Do not log complete user task text by default; store a generated identifier and a minimal sanitized summary.
  3. Disable traceback persistence in production and expose it only through an explicitly enabled debug mode.
  4. Create the log with owner-only permissions, such as mode 0600, and verify that the parent directory is not accessible to unintended users.
  5. Implement log rotation, maximum file size, expiration, and secure deletion policies.
  6. Separate operational logs from Agent memory so diagnostic content is not automatically loaded into future sessions.
  7. Encrypt sensitive logs at rest when retention is necessary.
  8. Implement and test cleanup_failed_tasks() rather than leaving retention management as a placeholder.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (22)

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The memory model explicitly elevates conversation records, user preferences, configuration details, and API-key-related content into long-term memory tiers. That creates a direct pathway for sensitive user data and secrets to be persistently retained beyond the immediate task, substantially increasing exposure in case of compromise, misuse, or overcollection.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The MemoryEntry structure serializes raw user requests, expected behavior, parameters, outputs, memory content, and failure reasons into Markdown and JSON. This broad retention of unredacted inputs and outputs can capture credentials, personal data, or confidential task content, making any memory file breach significantly more damaging.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file presents itself as a memory-maintenance skill, but the implementation also supports executing arbitrary tasks, spawning sub-sessions, configuring cron-like behavior, and creating skills. This capability mismatch is dangerous because it can mislead users or reviewers about the true authority of the skill and enable broader-than-expected actions under a benign description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill describes storing permanent memory including user preferences, task data, and even API-key-related categories without a prominent warning or consent model. Users may expose sensitive information to persistent storage without understanding retention scope, increasing privacy and secret-handling risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill includes a general-purpose execution engine that can create sessions, preload resources, stream execution steps, retry, and handle arbitrary task failures. That scope materially exceeds memory maintenance and creates a capability surface that could be repurposed to run unrelated or unsafe tasks under the guise of maintenance.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The scheduler automatically deletes temporary memory on a schedule, but the documentation does not clearly warn users that data may be removed without an interactive confirmation step. This can lead to silent data loss and undermine user expectations about what the system retains.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The scheduler automatically reads daily memory, identifies important entries, and promotes them into permanent memory with no clear privacy review or user approval step. This automation increases the likelihood that sensitive user content is retained long-term simply because heuristic scoring marked it as important.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The usage example explicitly shows spawning a subagent session to perform a user-provided task, demonstrating arbitrary delegated task execution rather than mere memory upkeep. In an agent environment, this can be abused to trigger unintended actions with the skill's authority and make the memory tool a wrapper for broader automation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The instructions encourage running the scheduler in the background or via cron without clearly warning that it will autonomously read, modify, promote, and delete memory files. Autonomous background file operations increase the risk of unintended persistence, tampering, or data loss if the user does not fully understand the behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill advertises broad capabilities including task execution, memory management, progress reporting, and auto-recovery, while the examples span unrelated domains such as scheduling, skill creation, weather queries, and file organization. In a session-mode subagent, this weakly constrained scope can cause overbroad invocation and unnecessary authority use, increasing the chance that the agent handles sensitive tasks or memory operations outside a narrowly defined purpose.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The design intentionally retains user-provided information in natural-language memory files and logs, which creates a persistent data exposure surface. Because the content is free-form, it can easily capture secrets, personal details, or sensitive context that later becomes accessible to other components or operators.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The memory template explicitly normalizes storing preferences, habits, decisions, and daily activities as long-term memory. This encourages accumulation of personal behavioral data beyond what is needed for task execution, increasing privacy risk and the blast radius of any compromise or misuse.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill contains code paths for creating skills, configuring scheduled tasks, and executing generic session-based tasks despite lacking a tightly defined purpose or guardrails. Broad operational capabilities increase the attack surface and make privilege misuse more likely, especially when task inputs come from users or upstream agents.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Successful task results are automatically transformed into persistent memory entries, which can unintentionally preserve sensitive user content or outputs. Automatic persistence without content classification or approval is risky because benign tasks may still include personal information, credentials, or confidential summaries.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The generated memory entry includes the task description and memory content verbatim, which directly increases the chance of persisting sensitive user input. Verbatim storage is especially risky in a general-purpose task runner because the task text may contain private requests, identifiers, or operational details.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill writes memory records to persistent files without clearly informing the user that task details will be retained. This creates a privacy and data-retention risk because users may provide sensitive information assuming it is ephemeral, but the skill stores it automatically.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Failure logs record detailed task data, errors, and tracebacks to disk, which may capture sensitive inputs, internal paths, or secrets leaked through exceptions. Persistent verbose logging broadens the exposure surface and may later disclose data to other tools, users, or administrators.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The failure logging logic persists task details, errors, and potentially tracebacks to disk without explicit disclosure. Error data often contains sensitive inputs, paths, tokens, or generated content, so silent persistence increases the risk of unintended exposure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code prompts the user only in Chinese for task description and expected behavior, which imposes a specific language on the interaction. The file does not provide any opt-in, fallback, or documented justification for restricting the skill to Chinese.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The schedule declares weekly review/cleanup as occurring on '每周日' (every Sunday), but the code checks now.weekday() == 0, which in Python corresponds to Monday. This creates a clear divergence between stated intent and actual execution timing.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The schedule text says permanent-memory audit runs on '每月 1 日 00:00' (the 1st day of every month), but the implemented condition later only triggers when now.day == 1 and now.month == 1, i.e. January 1st only. This is an active contradiction between the documentation-like schedule and the actual code behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The skill name and description are entirely in Chinese, which can imply a fixed language experience. There is no accompanying indication that language is configurable, user-selected, or justified as a region-specific skill, so this may violate language/locale policy expectations.

Content

No source excerpt is available for this finding.