Back to skill

Security audit

auto_dream

Security checks for vulnerabilities and agentic risk

Overview

This memory skill is mostly purpose-aligned, but it reads broad session history and persists or rewrites long-term memories without strong scoping or review controls.

Review this skill before installing if you use OpenClaw for private or sensitive work. It is not clearly malicious, but running Dream mode can scan recent conversations, write durable memories, delete or rewrite prior memories, and leave an aggregated prompt file on disk. Prefer installing only if you are comfortable managing the memory directory, reviewing proposed changes, and keeping sensitive data out of logs and sessions.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
scripts/auto_dream.py:197
Finding

Untrusted memory entries can hijack consolidation instructions and poison persistent agent memory

Content
View full analysis
str: """ 构建 4 阶段蒸馏 prompt(参考 Claude Code consolidationPrompt.ts) """ memory_root = str(AUTO_DREAM_DIR) memory_manifest = format_memory_manifest(scan_memory_files()) daily_logs = read_daily_logs(days_back=7) logs_content = "\n\n".join([ f"## {date}\n{content}" for date, content in sorted(daily_logs.items(), reverse=True) ]) prompt = f"""# Dream: Memory Consolidation You are performing a dream — a reflective pass over your memory files. Synthesize what you've learned recently into durable, well-organized memories so that future sessions can orient quickly. Memory directory: `{memory_root}` This directory already exists — write to it directly (do not run mkdir or check for its existence). --- ## Phase 1 — Orient - `ls` the memory directory to see what already exists - Read `MEMORY.md` to understand the current index - Skim existing topic files so you improve them rather than creating duplicates - Check `logs/` subdirectory for recent append-only log entries ## Phase 2 — Gather recent signal Look for new information worth persisting. Sources in rough priority order: 1. **Daily logs** (`logs/YYYY/MM/YYYY-MM-DD.md`) — these are the append-only stream: ``` {logs_content} ``` 2. **Existing memories tha ...[truncated 2701 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/auto_dream.py:289
Finding

Dream mode reads broadly scoped session transcripts through unconstrained indexed file paths

Content
View full analysis
dict: """读取 sessions.json 索引""" sessions_file = SESSIONS_DIR / "sessions.json" if not sessions_file.exists(): return {} with open(sessions_file, 'r', encoding='utf-8') as f: return json.load(f) def get_recent_session_snippets(days_back: int = 7, max_chars: int = 5000) -> str: """获取最近会话的关键片段(用于 AI 分析)""" sessions = read_sessions_index() snippets = [] cutoff = datetime.now() - timedelta(days=days_back) for key, info in sessions.items(): session_file = info.get('sessionFile') if not session_file or not Path(session_file).exists(): continue # 跳过飞书会话(太多噪音),只取 main/cron # if 'feishu' in key: # continue try: messages = [] with open(session_file, 'r', encoding='utf-8') as f: for line in f: line = line.strip() if not line: continue obj = json.loads(line) if obj.get('type') != 'message': continue msg = obj.get('message', {}) role = msg.get('role') if role in ('system', 'tool'): continue # 解析时间戳 ts = obj.get('timestamp', 0) if isinstance(ts, str): try: from datetime import timezone ts_dt = datetime.fromisoformat(ts.replace('Z', '+00:00')) msg_time = ts_dt.astimezone().replace(tzinfo=None) ...[truncated 4037 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • 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 (14)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/auto_dream.py (reported line 282)May include surrounding context.

python
{extra if extra else ""}
"""
    return prompt


# ============================================================================

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/auto_dream.py (reported line 551)May include surrounding context.

python
{extra if extra else ""}
"""
    return prompt


# ============================================================================

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases "整理记忆" and especially "dream" are broad enough to occur in normal conversation, making accidental invocation plausible. Because Dream mode reads logs, existing memories, and recent conversation history, an unintended trigger could cause unanticipated consolidation and persistence of user data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill states that AI will read daily logs, existing memory files, and recent session records, but it does not present this as a prominent user warning or consent boundary. Users may not realize that invoking Dream mode causes broad retrospective review and consolidation of prior conversation into persistent storage.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The design instructs the agent to read logs, memory files, and recent conversation history, then convert selected content into persistent natural-language memory. This creates a real data retention risk because sensitive conversational details may be copied into durable files where they are easier to expose, misuse, or retain longer than intended.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The prompt directs the AI to inspect daily logs and even grep session records for signals worth preserving, which encourages broad harvesting of conversational content beyond narrowly scoped user requests. In context, this increases the chance that secrets, personal information, or one-off contextual details are elevated into long-term memory without sufficient necessity or consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The consolidation workflow explicitly allows the AI to delete memories deemed outdated or contradicted, but the skill does not warn users that existing records may be removed or rewritten. That omission can lead to silent loss of data integrity, auditability, or user-trusted notes if the model makes an incorrect judgment.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The append examples use ordinary phrases like "记住 XXX" and "以后要记得 YYY", which can easily overlap with everyday conversational requests rather than a deliberate persistence command. This creates a risk that sensitive or transient statements are automatically written into long-term logs without the user's informed intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Natural-language strings in the module docstring and command guidance are predominantly Chinese, which effectively imposes a language choice on users. The file does not indicate that this is a region-specific tool or offer an opt-in/alternative locale, so it conflicts with the language/locale policy criterion.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The dream workflow is designed to synthesize append-only logs into durable memories, including user preferences, goals, and project details. That creates a plain-language long-term retention mechanism that can accumulate sensitive personal or operational information beyond what users may expect from transient assistance.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The surrounding text says 'Session transcript snippets' are a source of signal and the function accepts a transcript_snippets parameter, but line L233 injects logs_content again when transcript_snippets is present. This is an active contradiction between the prompt's stated use of transcript snippets and what the code actually places into the prompt.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The prompt explicitly instructs the AI workflow to mine recent session transcripts and convert information into durable long-term memory files. In this skill context, that broad retention of conversational content increases privacy risk because user details may be extracted, summarized, and stored long-term without clear scoping or minimization.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code reads recent session transcript files and prepares their contents for AI-driven consolidation into memory artifacts without explicit consent, notice, or data minimization controls. This can cause privacy-sensitive user data from prior conversations to be silently reprocessed and retained beyond the original session scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The workflow writes a .dream_prompt.md file containing aggregated daily logs and potentially session-derived text to disk in plaintext. Persisting this intermediate prompt can expand the exposure window for sensitive data, especially if the workspace is backed up, synced, or accessible to other local users/processes.

Content

No source excerpt is available for this finding.