Back to skill

Security audit

A powerful memory management system powered by ReMe that provides persistent cross-session memory, automatic user preference application, and intelligent context compression for OpenClaw.

Security checks for vulnerabilities and agentic risk

Overview

This memory skill is coherent with its purpose, but it persistently stores and automatically reuses conversation-derived rules with weak privacy and control safeguards.

Install only if you are comfortable with a third-party ReMe package and API processing conversation content and with remembered preferences affecting later sessions. Before use, pin and review `reme-ai`, avoid storing secrets or sensitive client data, require explicit approval before saving or applying behavioral rules, and periodically inspect and delete stored memories.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T02 · Agent Memory Poisoning

Error
Location
scripts/save_summary.py:191
Finding

Unvalidated conversation content can poison persistent Agent memory

Content
View full analysis

Vulnerability Details

File Location: scripts/save_summary.py:191-204
Additional Locations: scripts/add_memory.py:38-43, scripts/add_memory.py:68-76, scripts/add_memory.py:101-109, scripts/init_reme.py:39-42, references/best-practices.md:128-157, SKILL.md:380-406
Vulnerability Type: Persistent memory poisoning through unvalidated user-controlled content
Risk Level: High

Vulnerable Code

python
# Load messages from file
messages_file = sys.argv[2] if sys.argv[1] == "--auto" else sys.argv[1]

try:
    with open(messages_file, 'r', encoding='utf-8') as f:
        messages = json.load(f)

    print(f"✓ Loaded {len(messages)} messages from {messages_file}")

    # Save summary
    if sys.argv[1] == "--auto":
        await save_with_auto_cleanup(reme, messages)
    else:
        await save_session_summary(reme, messages)

The persistence operation is performed without validating the content or authority of the supplied messages:

python
# Write to memory file
filename = f"memory/{date_str}.md"

print(f"\n📝 Writing to {filename}...")
await reme.summary_memory(messages=messages)

print("✓ Summary saved")

Technical Analysis

The Skill treats conversation content and user feedback as suitable input for persistent memory. A caller-controlled JSON file is parsed and its complete message array is passed to reme.summary_memory without:

  • Restricting memories to a defined preference schema.
  • Distinguishing descriptive preferences from executable Agent instructions.
  • Verifying the identity or authority of the user creating the memory.
  • Detecting prompt injection or tool-use directives.
  • Requiring confirmation before creating a persistent rule.
  • Assigning scope, expiration, provenance, or integrity metadata.
  • Revalidating retrieved memories before they influence future behavior.

The related feedback-learning workflow similarly converts corr ...[truncated 2304 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace free-form persistent instructions with a strict, allowlisted preference schema, such as formatting style, language, or explicitly permitted notification settings.
  2. Reject memory values containing tool calls, security-policy changes, credential requests, file-transmission directives, or instructions to override higher-priority rules.
  3. Require explicit user confirmation before storing any cross-session memory.
  4. Record the authenticated owner, source conversation, creation time, scope, expiration time, and approval status for every memory.
  5. Keep descriptive user facts separate from behavioral instructions. Persistent records must never be executed or applied directly as prompts.
  6. Revalidate every retrieved memory against current safety policies before applying it.
  7. Scope memory by user, workspace, task, and session to prevent cross-user or cross-project contamination.
  8. Provide commands to inspect, revoke, and delete stored memories.
  9. Remove active user-attributed preferences bundled with the Skill package, or mark them as inert examples that are never loaded as user memory.
  10. Add adversarial tests covering persistent prompt injection, malicious tool directives, conflicting preferences, and stale or forged memory records.

T08 · Insecure Dependencies

Warning
Location
README.md:26
Finding

Unpinned third-party dependency processes unredacted conversation histories

Content
View full analysis

Vulnerability Details

File Location: README.md:26-31
Additional Locations: SKILL.md:52-55, scripts/save_summary.py:34-38, scripts/save_summary.py:191-204, scripts/add_memory.py:38-43
Vulnerability Type: Unpinned dependency with access to sensitive conversation data
Risk Level: Medium

Vulnerable Code

The documented installation retrieves the current package release without a version or integrity constraint:

bash
# Clone or download this skill
cd ~/.clawdbot/skills/memory-reme

# Install dependencies
pip install reme-ai

Complete message histories are subsequently loaded and passed to that dependency:

python
# Load messages from file
messages_file = sys.argv[2] if sys.argv[1] == "--auto" else sys.argv[1]

try:
    with open(messages_file, 'r', encoding='utf-8') as f:
        messages = json.load(f)

    print(f"✓ Loaded {len(messages)} messages from {messages_file}")

    # Save summary
    if sys.argv[1] == "--auto":
        await save_with_auto_cleanup(reme, messages)
    else:
        await save_session_summary(reme, messages)
python
# Write to memory file
filename = f"memory/{date_str}.md"

print(f"\n📝 Writing to {filename}...")
await reme.summary_memory(messages=messages)

print("✓ Summary saved")

Technical Analysis

The Skill depends on reme-ai, but does not provide a pinned version, hash, lockfile, vendored source, or verified package origin. Consequently, installations at different times may execute different dependency code even though the audited Skill files remain unchanged.

The dependency is initialized within the Agent process and receives complete message arrays through summary_memory. The local extract_key_events and generate_summary_text functions calculate a reduced summary, but that result is not supplied to the persistence call. Instead, the full original message collection is handed to the dependenc ...[truncated 2137 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin reme-ai to a specifically audited version.
  2. Use a lockfile or requirements file with cryptographic hashes, and install with hash verification enabled.
  3. Document the authoritative package repository, publisher identity, source-code location, and release-signing process.
  4. Review the dependency's network behavior, subprocess use, filesystem access, telemetry, and data-retention policy.
  5. Generate a minimal local summary and pass only that reduced representation to the dependency.
  6. Remove secrets, access tokens, credentials, personal information, file contents, and raw tool output before persistence.
  7. Require informed user consent before any conversation content is processed by an external API.
  8. Provide and default to a local-only backend where possible.
  9. Restrict runtime privileges through a dedicated environment, minimal filesystem permissions, and controlled outbound network access.
  10. Add dependency vulnerability scanning and reproducible installation checks to the release process.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (32)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

If the associated implementation deletes files from .reme/tool_result without declaring cleanup behavior, the skill description materially understates destructive file-system actions. Undisclosed deletion behavior is dangerous because users may invoke a 'memory' skill without realizing it can remove local artifacts or logs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

If the associated implementation deletes files from .reme/tool_result without declaring cleanup behavior, the skill description materially understates destructive file-system actions. Undisclosed deletion behavior is dangerous because users may invoke a 'memory' skill without realizing it can remove local artifacts or logs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the associated implementation deletes files from .reme/tool_result without declaring cleanup behavior, the skill description materially understates destructive file-system actions. Undisclosed deletion behavior is dangerous because users may invoke a 'memory' skill without realizing it can remove local artifacts or logs.

Content

No source excerpt is available for this finding.

Context Leakage

High
Category
Data Exfiltration
Confidence
97% confidence
Finding

The design explicitly records session summaries, user requests, outputs, feedback, and learnings across sessions, creating a persistent store of potentially sensitive conversation content. If this memory is over-collected, insufficiently scoped, or later surfaced to unrelated contexts, it can leak private data, secrets, or confidential project details across sessions.

Content

Scanner excerpt · references/memory-structure.md (reported line 196)May include surrounding context.

md
## memory/YYYY-MM-DD.md - Daily Summaries

### Purpose
Record session summaries, key events, and learnings for each day.

### Structure

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README explicitly promotes persistent cross-session memory, automatic preference application, and learning from user corrections, but it does not warn about privacy, consent, retention, or the risk of storing sensitive data. In a memory-management skill, omission of these safeguards can lead operators to deploy behavior that collects and reuses personal information across sessions without clear user awareness or control.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The example hard-codes language="zh" without explaining why that locale is required or how it should be chosen for a given user. In a memory and preference system, forcing a language setting can cause misclassification, incorrect retrieval, or accidental handling of user data under the wrong locale assumptions, though this is more of a safety/privacy design issue than a direct exploit path.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill instructs initialization, file-based memory storage, and package installation/use of a network-capable dependency, but it declares no explicit tool scope or permissions boundaries. This creates a capability-transparency problem: operators and users cannot clearly see that persistent file access and possible network-dependent package behavior are part of the skill’s 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 strongly encourages persistent storage of user preferences and cross-session memory but does not provide clear privacy notice, consent flow, retention limits, or sensitivity restrictions. This is dangerous because users may unknowingly have personal data retained and reused across sessions, increasing exposure and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Auto-generating and saving session summaries creates persistent logs of conversation content, but the skill does not warn users that their requests, outputs, and feedback may be archived. This can capture sensitive business, personal, or credential-adjacent information and make later unintended disclosure more likely.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill recommends storing session summaries and memory records that may include verbatim user requests and feedback in natural language. Persistent free-text storage is dangerous because it often accumulates sensitive information that can later be retrieved broadly, leaked through search, or reused out of context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Automatic application of stored user preferences can silently influence future behavior without the user realizing prior data is steering current actions. This is risky because stale, poisoned, or overly broad preferences may cause incorrect actions, privacy violations, or unsafe automation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The sample code sets language="zh", which forces a specific language/locale behavior. The document does not indicate that this is optional, user-selected, or required for a region-specific use case, so it appears to violate the language/locale choice policy.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The example memory structure persistently stores a user profile, requests, outputs, and feedback, all of which may contain sensitive personal or business information. Because the system later searches and reapplies this data routinely, it increases the chance of cross-session data leakage, over-collection, and unintended disclosure to future tasks or users.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
- ✓ Prevent repeated mistakes
- ✓ Remember user preferences
- ✓ Maintain context across sessions
- ✓ Learn from feedback
- ✓ Provide consistent behavior

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/best-practices.md (reported line 18)May include surrounding context.

Store preference but never use it

reme.add_memory("User prefers concise code")

Later... generate verbose code without checking

text

**Good Practice:**

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file contains natural-language guidance and examples that direct use of Chinese for comments and later code/query strings. The policy scope forbids forcing a specific language or locale unless the skill offers choice or clearly documents a justified regional constraint, which is not present here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document normalizes an automatic message.send(path=...) behavior immediately after file generation, with wording like '必须' and 'ALWAYS send', but does not require checking file contents, destination correctness, or whether the generated file contains sensitive or unintended data. In a memory/persistence skill, this is more dangerous because remembered preferences can silently trigger repeated disclosure behavior across sessions, increasing the chance of accidental data exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The preference sets exec background mode as the default and discourages PTY unless needed, but gives no safety constraints for supervising, limiting, or auditing spawned processes. Default unattended subprocess execution can leave long-running or unsafe commands operating outside the immediate interaction loop, increasing the risk of unintended system changes, persistence, resource abuse, or missed malicious behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The examples '所有回复使用中文' and 'All responses in English' are unconditional language mandates in the stored preference rules. Organizational language/locale policy requires explicit user choice or opt-in for such constraints, and these rule texts do not themselves express that safeguard.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The example MEMORY.md encodes communication and content rules entirely in Chinese, including a communication preference that effectively fixes the response format and language context around a specific Chinese-speaking user. Because this reference guide presents that example as a model structure without any note that language should be chosen by the user, it can normalize a locale-specific behavior without explicit opt-in.

Content

No source excerpt is available for this finding.

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.

Content

Scanner excerpt · references/memory-structure.md (reported line 362)May include surrounding context.

md
## tool_result/*.txt - Tool Output Cache

### Purpose
Store outputs from tools that exceed the context window threshold.

### File Format

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/memory-structure.md (reported line 375)May include surrounding context.

md
1. **Created**: When tool output exceeds threshold (default 1000 chars)
2. **Referenced**: Original message contains file path reference
3. **Retained**: For retention_days (default 7 days)
4. **Cleaned**: Automatically deleted after retention period

### Example Reference in Message

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The function signature sets the default language to "zh", and the script also falls back to "zh" from the command line path when no language is provided. This creates a language policy issue because the skill defaults to a specific language instead of offering a neutral default or explicit user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The memory search query uses only Chinese terms ("用户偏好 偏好 规则"), which bakes a specific language assumption into core behavior. This can exclude users in other languages and indicates a locale-specific constraint without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The top-level comments and docstrings state that the script saves a session summary, but the implementation does not save the generated summary text at all. Security-relevant misrepresentation is risky here because operators may approve or invoke the skill assuming reduced-data retention, while the actual code persists raw conversation content through another subsystem. In a long-term memory skill, misleading data-handling claims materially increase privacy and compliance risk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.