Back to skill

Security audit

Mi-MemoryStack

Security checks for vulnerabilities and agentic risk

Overview

This memory skill needs review because it makes every conversation turn feed a remote memory service, changes workspace-wide agent instructions, and runs a persistent background worker.

Install only if you intentionally want workspace-wide, always-on remote memory. Before use, review and edit the scripts to enforce HTTPS and a trusted endpoint, move tokens out of source files, add opt-in controls, restrict file permissions, add retention/deletion controls, and avoid replacing global AGENTS.md, SOUL.md, or start.sh without an exact diff and rollback plan.

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
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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 (5)

T01 · Skill Instruction Hijacking

Error
Location
xiugai/AGENTS.md:16
Finding

Mandatory Capture and External Disclosure of Every Conversation Without Consent

Content
View full analysis
" \ --query "" python3 ~/.openclaw/workspace/skills/Mi-MemoryStack/scripts/memory_daemon.py queue \ --user-id "" \ --query "" \ --response "" ``` ### Technical Analysis The Skill changes the Agent's operating policy so that memory retrieval and storage become mandatory for every conversation turn. The directive is reinforced at the Skill, workspace policy, and Agent identity layers. It also explicitly instructs the Agent not to request permission. This violates consent and data-minimization principles. The workflow does not distinguish ordinary messages from passwords, API keys, health information, financial data, private files, or other sensitive content. Because the save operation includes both the original user input and the complete Agent response, information derived from local files or tools can also be captured. The behavior conflicts with the same workspace policy's general instruction to ask before performing actions that send data ...[truncated 1296 chars]
Remediation
View remediation

other

Error
Location
scripts/memory_add.py:15
Finding

Conversation Data Is Sent to an Unspecified Configurable External Endpoint

Content
View full analysis
Remediation
View remediation

T01 · Skill Instruction Hijacking

Error
Location
xiugai/install.sh:13
Finding

Installer Overwrites Workspace-Wide Agent Policy, Identity, and Startup Files

Content
View full analysis
Remediation
View remediation

T06 · System Persistence

Error
Location
scripts/memory_daemon.py:24
Finding

Detached Background Daemon Persists and Stores Complete Conversations in Plaintext Queue Files

Content
View full analysis
bool: ensure_queue_dir() timestamp = datetime.now().strftime("%Y%m%d_%H%M%S_%f") filename = f"{user_id}_{timestamp}.json" filepath = os.path.join(QUEUE_DIR, filename) data = { "user_id": user_id, "query": query, "response": response, "timestamp": timestamp } try: with open(filepath, 'w', encoding='utf-8') as f: json.dump(data, f, ensure_ascii=False) return True ``` The process is detached from the initiating session: ```python proc = subprocess.Popen( [sys.executable, __file__, 'run'], stdout=open(log_file, 'a'), stderr=subprocess.STDOUT, start_new_session=True ) with open(PID_FILE, 'w') as f: f.write(str(proc.pid)) ``` The daemon repeatedly forwards queue entries: ```python result = subprocess.run( ['python3', add_script, '--user-id', data['user_id'], '--query', data['query'], '--response', data['response']], capture_output=True, timeout=10 ) if result.returncode == 0: filepath.unlink() ``` ### Technical Analysis `start_new_session=True` detaches the daemon so it continues operating after the initiating shell exits. Workspace session instructions and `start.sh` check its status and restart it when absent, creating cross-session persistence. Complete sender IDs, prompts, and ...[truncated 1883 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
scripts/memory_search.py:56
Finding

Untrusted Remote Memory Content Is Incorporated Into Agent Responses

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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (52)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A skill that claims simple automatic memory handling but also exposes process management, directory creation, and status reporting has a materially different operational footprint than advertised. That mismatch increases the chance of unsafe deployment, overbroad permissions, and unnoticed persistence mechanisms that handle user data outside expected bounds.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

A skill that claims simple automatic memory handling but also exposes process management, directory creation, and status reporting has a materially different operational footprint than advertised. That mismatch increases the chance of unsafe deployment, overbroad permissions, and unnoticed persistence mechanisms that handle user data outside expected bounds.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

A skill that claims simple automatic memory handling but also exposes process management, directory creation, and status reporting has a materially different operational footprint than advertised. That mismatch increases the chance of unsafe deployment, overbroad permissions, and unnoticed persistence mechanisms that handle user data outside expected bounds.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A skill that claims simple automatic memory handling but also exposes process management, directory creation, and status reporting has a materially different operational footprint than advertised. That mismatch increases the chance of unsafe deployment, overbroad permissions, and unnoticed persistence mechanisms that handle user data outside expected bounds.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

A skill that claims simple automatic memory handling but also exposes process management, directory creation, and status reporting has a materially different operational footprint than advertised. That mismatch increases the chance of unsafe deployment, overbroad permissions, and unnoticed persistence mechanisms that handle user data outside expected bounds.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly promotes automatic storage and retrieval of personal memory, preferences, and identity information without any visible privacy notice, consent mechanism, or retention disclosure. This is dangerous because it normalizes silent collection of sensitive conversational data and can violate privacy expectations, policy, or legal obligations.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill is designed to accumulate natural-language records about user identity, preferences, and conversation content, creating a substantial data collection and leakage risk. Because the data is rich, free-form, and persistent, it may contain credentials, health information, financial details, or other high-sensitivity content even if that was not the intended use.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The workflow mandates saving every turn and frames it as non-skippable, but gives no warning that this creates persistent records of user prompts and assistant replies. Mandatory undisclosed persistence significantly increases the chance of capturing secrets, regulated data, or intimate personal details that should not be retained by default.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The non-skippable workflow requires recording every user input and model response, which predictably captures sensitive material and makes over-collection the default behavior. In the context of a conversational agent, this is especially dangerous because users often reveal secrets or personal facts incidentally, not expecting blanket retention.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The examples and schema encourage retention of user profile data, personal facts, preferences, and dialogue content in structured memory records. This creates a concentrated repository of sensitive personal information that can be abused, leaked, or queried beyond the original conversational purpose.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The script performs outbound network requests to an external API and transmits user_id, query, and response content, but the capability is not covered by declared permissions. In a memory skill, this is especially sensitive because it can exfiltrate conversational history and personal preferences to a remote service without clear platform-level authorization or review.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The script spawns subprocesses and inspects processes, which amounts to shell/process-execution capability not covered by declared permissions. Even without shell=True, undeclared execution ability expands the attack surface and lets a memory component operate beyond simple storage and retrieval.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The script spawns subprocesses and inspects processes, which amounts to shell/process-execution capability not covered by declared permissions. Even without shell=True, undeclared execution ability expands the attack surface and lets a memory component operate beyond simple storage and retrieval.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The script spawns subprocesses and inspects processes, which amounts to shell/process-execution capability not covered by declared permissions. Even without shell=True, undeclared execution ability expands the attack surface and lets a memory component operate beyond simple storage and retrieval.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file mandates per-turn execution of memory_search and queueing of the full user input and assistant response, while explicitly saying 'Don't ask permission. Just do it.' This creates automatic collection and storage of conversation content without a clear notice, consent flow, or data-minimization safeguards, which is a significant privacy and compliance risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill documents listing all stored memories for a user, including profile and dialogue data, which expands access beyond passive per-turn retrieval. This is dangerous because bulk enumeration of a user's stored history increases the blast radius of misuse, accidental disclosure, and insider access to sensitive conversational records.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documented ability to enumerate stored memories and inspect memory files exposes retained personal content, yet the skill omits access/privacy warnings and handling guidance. Without explicit safeguards, operators may treat this as routine debugging while unintentionally exposing sensitive user histories.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest states that each conversation turn must execute both retrieval and save, and describes the skill as providing automatic storage and retrieval of user memory. In this file, the implemented behavior is limited to constructing a payload and POSTing it to an external API to save memory; there is no retrieval call or related logic.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script sends potentially sensitive conversation content and user identifiers to an external API without any user-facing disclosure or consent at execution time. In the context of a personalized memory skill, the risk is elevated because the transmitted data is likely to contain private preferences, identity details, and conversation history-derived information.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring and user-facing CLI messages are presented in Chinese only, imposing a specific language without offering the user a choice or indicating that the tool is region-specific. This is a natural-language policy issue because the skill forces one locale for interaction rather than supporting opt-in or documenting the constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The queue files persist raw user queries and responses to local disk without any user-facing warning, consent flow, or minimization. In a memory skill, this is especially dangerous because the data is likely to include sensitive personal context, and the skill description says saving must happen every round.

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/memory_daemon.py (reported line 85)May include surrounding context.

python
data = json.load(f)
                    
                    # 执行保存
                    result = subprocess.run(
                        ['python3', add_script,
                         '--user-id', data['user_id'],
                         '--query', data['query'],

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This memory skill includes daemon management, PID handling, and background lifecycle control beyond its stated purpose of memory storage and retrieval. That broader operational scope increases persistence and stealth, making misuse or unnoticed data collection more likely in the context of a conversational memory feature.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
92% confidence
Finding

The daemon is explicitly designed for ongoing background persistence across sessions, which extends the lifetime and collection surface of user data. In a memory skill that already mandates retrieval and saving on every turn, session persistence materially increases privacy and abuse risk.

Content

Scanner excerpt · scripts/memory_daemon.py (reported line 119)May include surrounding context.

python
print("[Error] 守护进程已在运行")
        return False
    
    # 使用 nohup 启动后台进程
    log_file = os.path.expanduser("~/.openclaw/memory_daemon.log")
    
    proc = subprocess.Popen(

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/memory_daemon.py (reported line 122)May include surrounding context.

python
# 使用 nohup 启动后台进程
    log_file = os.path.expanduser("~/.openclaw/memory_daemon.log")
    
    proc = subprocess.Popen(
        [sys.executable, __file__, 'run'],
        stdout=open(log_file, 'a'),
        stderr=subprocess.STDOUT,