Back to skill

Security audit

Dream

Security checks for vulnerabilities and agentic risk

Overview

This memory skill is not clearly malicious, but it needs Review because it stores and rewrites personal memory automatically and includes helper-script paths that can exceed the advertised file scope.

Review carefully before installing. This skill is designed to preserve and reuse personal memory long term, including a permanent ledger that `dream forget` does not erase. Avoid it for sensitive, shared, regulated, or multi-user workspaces unless you are comfortable with silent scheduled maintenance, broad memory indexing, and the current helper-script security weaknesses being fixed first.

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

T09 · Insecure Skill Coding Practices

Error
Location
dream-tools.sh:91
Finding

Unrestricted Arbitrary File Replacement Through --atomic-write

Content
View full analysis
" [[ ! -f "$tmpfile" ]] && die "tmp 文件不存在:$tmpfile" # 若目标是 MEMORY.md,检查字符数上限 if [[ "$(realpath "$target" 2>/dev/null)" == "$(realpath "$MEMORY_MD" 2>/dev/null)" ]] || \ [[ "$target" == *"MEMORY.md" ]]; then local size size=$(wc -c < "$tmpfile" | tr -d ' ') if [[ $size -gt $MEMORY_HARD_LIMIT ]]; then die "写入中止:tmp 文件大小 ${size} 字符,超过硬上限 ${MEMORY_HARD_LIMIT}。请先压缩内容。" fi log "MEMORY.md 写入校验通过:${size}/${MEMORY_HARD_LIMIT} 字符" fi ensure_dir "$target" # mv 在同一文件系统上是原子操作 mv "$tmpfile" "$target" log "原子写入完成:$target" } ``` ### Technical Analysis The `--atomic-write` operation accepts caller-controlled source and destination paths without enforcing an allowed directory or destination list. Although special size validation is attempted for paths resembling `MEMORY.md`, every other destination is accepted without scope validation. The function also calls `ensure_dir`, which creates the destination's parent directory, and then uses `mv` to replace the destination. It does not verify that: - The destination is the configured `MEMORY_MD`. - The destination is inside `DREAM_VAULT_PATH` or `OPENCLAW_WORKSPACE`. - The source is an approved temporary file. - The source or destination does not traverse symbolic links. - The destination is a regular file rather than a sensitive configuration or instruction file. The suffix test `[[ "$target" == *"MEMORY.md" ]]` is not a security boundary. It only applies a size limit and still permits an arbitrary path ending in `MEMORY.md`. This behavior contradicts the README claim that file operations ...[truncated 1453 chars]
Remediation
View remediation
``` 10. Add tests covering absolute paths, `..` traversal, symlink traversal, paths outside the workspace, and unrelated files ending in `MEMORY.md`. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
dream-tools.sh:453
Finding

Python Code Injection Through last-review.txt

Content
View full analysis
/dev/null; then hours_since=$(python3 -c " from datetime import datetime last = datetime.strptime('$last_review', '%Y-%m-%d %H:%M') diff = datetime.now() - last print(int(diff.total_seconds() / 3600)) " 2>/dev/null || echo "-") fi fi ``` ### Technical Analysis The content of `meta/last-review.txt` is inserted directly into a Python program passed to `python3 -c`. No syntax-safe argument passing or format validation is performed. A malicious value can terminate the quoted timestamp, supply additional Python statements, and comment out the remainder of the generated line. Because Python can import modules and start processes, this provides command execution under the account running the helper. Shell quoting of `"$last_review"` does not protect the Python interpreter. The unsafe interpretation occurs after shell expansion, when Python parses the resulting source code. ### Attack Path 1. An attacker or compromised local component obtains write access to: ```text $DREAM_VAULT_PATH/meta/last-review.txt ``` 2. The attacker stores a value structured like: ```text 2026-01-01 00:00', '%Y-%m-%d %H:%M'); __import__('os').system('id > /tmp/dream-pwned'); # ``` 3. The user or agent invokes: ```bash dream-tools.sh --status ``` 4. The generated Python line becomes equivalent to: ```python last = datetime.strptime('2026-01-01 00:00', '%Y-%m-%d %H:%M'); __import__('os').system('id > /tmp/dream-pwned'); #', '%Y-%m-%d %H:%M') ``` 5. Python executes the injected operating-system command. This path requires the attacker to influence the state file. ...[truncated 858 chars]
Remediation
View remediation

other

Warning
Location
Skill.md:270
Finding

Forget Operation Retains and May Reactivate Sensitive Personal Data

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (18)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill declares daily memory files are read-only for Dream, but later authorizes write and delete operations against those same memory stores. That contradiction can cause an implementation to exceed intended boundaries and modify canonical user-memory records, increasing the chance of silent tampering, data loss, or unauthorized persistence behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

dream forget performs destructive deletion from memory stores without confirmation. A mistaken match, ambiguous description, prompt injection, or accidental invocation could irreversibly remove user data or selectively erase context that would otherwise help detect abuse or preserve user intent.

Content

No source excerpt is available for this finding.

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

Scanner excerpt · readme.md (reported line 12)May include surrounding context.

md
OpenClaw's native memory mechanism has three unhandled issues:

**1. MEMORY.md grows indefinitely and silently truncates**
OpenClaw truncates MEMORY.md at 20,000 characters — no error, no warning. The AI quietly loses the second half of your context. You think it remembers, but it doesn't. Dream triggers compression at 18,000 characters, archiving stale content to the ledger so MEMORY.md always stays within the effective range.

**2. No permanent archive**
Important memories disappear once cleaned up. Dream maintains a `ledger.md` — append-only, never deleted. Anything that has ever reached long-term memory is preserved forever, even after being forgotten, and remains searchable for deep recall.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documented trigger phrases are extremely broad, including generic words like dream, review, and a natural-language query asking what the system remembers. In an agent setting, such triggers can be activated during ordinary conversation, causing unintended memory operations or disclosure of sensitive memory contents without clear user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

The manifest description and the rest of the skill are written as Chinese-only instructions and trigger phrases, with no indication that users may choose another language. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern unless the locale restriction is clearly justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation states 'Dream 的职责是蒸馏者,不是捕获者', which narrows intent to post-hoc distillation only. However, later sections direct the skill to '直接写入 MEMORY.md' during live conversation and to also record into daily memory files, which is active capture behavior rather than mere distillation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill authorizes automatic real-time writes to persistent memory during conversation without clear user-facing notice or opt-in. This can cause users to disclose sensitive information under the assumption it is ephemeral, while the agent silently persists it to long-lived files.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill prescribes broad ongoing capture of user preferences, decisions, projects, corrections, and inferred content into persistent memory files. Without narrow retention rules, sensitivity checks, or explicit consent, this creates a durable behavioral profile that can be misused, over-retained, or exposed through later summaries and search operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Scheduled silent maintenance performs background writes, compaction, and archival without clear upfront warning or runtime visibility. This is dangerous because the system can alter or move user data while the user is unaware, making consent, accountability, and incident investigation harder.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill directs persistent retention and summarization of personal and contextual information for an Obsidian index without meaningful minimization, consent, or sensitivity filtering. In context, this is more dangerous because the skill is explicitly designed for long-term memory accumulation, increasing privacy risk, profiling, and secondary use of data beyond the user's immediate request.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The wakeup flow automatically surfaces stored memory and archive summaries at the first new conversation after inactivity. This can expose sensitive historical information at an unexpected moment, including in shared environments or when the user did not ask for a recap, turning persistence into unsolicited disclosure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This shell script embeds its description and usage text in Chinese, and the command help later in the file is also Chinese-only. Because the file does not provide any opt-in, alternative language, or justification for a Chinese-only locale, it creates a natural-language policy concern under the language/locale rule.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The script intentionally persists session-derived data to disk across multiple files, including MEMORY.md, ledger.md, ledger-index.json, removed-entries.json, and active-days.json. In an agent skill context, this creates a real retention risk: sensitive prompts, user content, URLs, or operational history may be stored long-term without redaction, minimization, access controls, or consent checks, increasing exposure if the workspace or vault is later accessed by another user, process, or backup system.

Content

Scanner excerpt · dream-tools.sh (reported line 502)May include surrounding context.

sh
--check-idle)             cmd_check_idle ;;
    --check-size)             cmd_check_size ;;
    --hash)                   cmd_hash "$@" ;;
    --atomic-write)           cmd_atomic_write "$@" ;;
    --ledger-append)          cmd_ledger_append "$@" ;;
    --ledger-search)          cmd_ledger_search "$@" ;;
    --ledger-mark-reemergence) cmd_ledger_mark_reemergence "$@" ;;

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README explicitly describes indefinite preservation of user memories in a searchable permanent archive, which materially increases privacy and data-exposure risk. In a memory skill, retaining sensitive personal information forever—even after it is 'forgotten' from active memory—creates a larger attack surface and undermines user expectations around deletion.

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 silent nightly operation and permanent archival of memories, but the usage section does not foreground the privacy and persistence implications. Users may enable it without understanding that personal data is retained indefinitely and files are modified automatically, increasing the risk of uninformed consent and accidental over-retention of sensitive information.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Returning a full MEMORY.md snapshot in response to a natural-language query can expose sensitive personal context too broadly, especially if the trigger is matched unintentionally or in mixed-user/shared environments. This creates a straightforward data disclosure risk because memory contents may include profile, relationship, and current-state information accumulated over time.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The section says 'dream search calls the native command, does not build its own index,' which asserts no custom indexing behavior. Elsewhere, the README explicitly describes obsidian-index/ files being created and a dream index <content> command that saves articles or webpages into that index, directly contradicting the claim.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The security claim is absolute about file-operation scope. However, the installation steps instruct appending an export line to ~/.zshrc, which is a write outside DREAM_VAULT_PATH and the OpenClaw workspace, so the documentation overstates the scope restriction.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.