Back to skill

Security audit

Dream

Security checks for vulnerabilities and agentic risk

Overview

This memory skill is mostly purpose-aligned, but it keeps personal memory indefinitely, can restore forgotten items, runs silent memory updates, and ships script commands with real local file-safety flaws.

Review this carefully before installing. It is not clearly malicious, but it is a high-retention memory system: archived memories are kept forever, 'forget' does not purge the archive, forgotten topics can re-enter memory, and some actions run silently. The included script should be fixed before use, especially path scoping for --atomic-write and safe parsing of last-review.txt.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
dream-tools.sh:454
Finding

Arbitrary Python Code Execution Through Unvalidated Timestamp State

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 contents of `meta/last-review.txt` are read into `last_review` and interpolated directly into source code passed to `python3 -c`. Shell quoting does not make this safe because the value is inserted inside a Python string literal. A malicious timestamp containing a single quote followed by valid Python statements can terminate the intended string and inject arbitrary Python code. For example, a crafted value can import `os` and invoke system commands before commenting out the remainder of the generated line. The script neither validates the timestamp format before interpolation nor passes the value through a non-code channel such as a command-line argument or environment variable. The exception fallback does not prevent exploitation because injected statements execute before a later parsing error is handled by the shell. ### Attack Path 1. An attacker, another local process, or an agent operation modifies: `DREAM_VAULT_PATH/meta/last-review.txt`. 2. The attacker supplies content designed to terminate the Python string and insert Python statements. 3. The user or agent invokes: ```bash dream-tools.sh --status ``` 4. `cmd_status` places the malicious file content directly into the program passed to `python3 -c`. 5. Python executes the injected statements with ...[truncated 541 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
dream-tools.sh:88
Finding

Unrestricted Arbitrary File Replacement in Atomic Write Command

Content
View full analysis
# Verifies tmp-file exists and does not exceed the hard limit, then atomically replaces target-file # For MEMORY.md targets, also enforces character count; other files only check existence cmd_atomic_write() { local target="${1:-}" local tmpfile="${2:-}" [[ -z "$target" || -z "$tmpfile" ]] && die "--atomic-write requires " [[ ! -f "$tmpfile" ]] && die "tmp file does not exist: $tmpfile" # If target is MEMORY.md, check character count limit 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 "Write aborted: tmp file size ${size} chars exceeds hard limit ${MEMORY_HARD_LIMIT}. Please compress content first." fi log "MEMORY.md write validation passed: ${size}/${MEMORY_HARD_LIMIT} chars" fi ensure_dir "$target" # mv is atomic on the same filesystem mv "$tmpfile" "$target" log "Atomic write complete: $target" } ``` ### Technical Analysis The `--atomic-write` interface accepts an arbitrary target path and moves the supplied temporary file to that location. It does not verify that the destination is inside `OPENCLAW_WORKSPACE` or `DREAM_VAULT_PATH`. The `realpath` comparison is used only to decide whether to enforce a size limit. It is not an authorization check. The suffix test, `"$target" == *"MEMORY.md"`, likewise does not restrict the destination. Absolute paths and traversal paths therefore remain accepted. This behavior contradicts the README claim that file operations are strictly scoped to t ...[truncated 1294 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Warning
Location
Skill.md:264
Finding

Forget Operation Permanently Retains and Automatically Restores Removed Memories

Content
View full analysis
` — Remove from Memory Semantic search in `memory/YYYY-MM-DD.md` and MEMORY.md for matching entries and remove them. No confirmation required — executes immediately. **Re-emergence mechanism:** On removal, write the entry summary to `meta/removed-entries.json` along with removal timestamp and content hash. If the content reappears in a later conversation, automatically trigger re-emergence: rewrite to MEMORY.md and elevate priority. Content that was forgotten and then reappears is more worth keeping than content that was never forgotten. Ledger records are not affected by `dream forget` — they are permanently preserved. On execution, inform the user: "Removed from memory. The permanent archive is unaffected." ``` ### Technical Analysis The documented forget operation does not provide complete deletion semantics. It removes matching material from active memory while retaining a summary and content hash in `removed-entries.json`, and it explicitly preserves corresponding ledger records permanently. The skill further directs the agent to restore similar content to `MEMORY.md` automatically and increase its retention priority. Consequently, an explicit user decision to forget information can be reversed without renewed confirmation. Because `MEMORY.md` is injected into future conversations, restored content affects persistent agent context. Similar later content—or content deliberately introduced to trigger the matching mechanism—can cause previously removed information to return. ### Attack Path 1. Sensitive information is stored in `MEMORY.md`, a daily memory file, or the permanent ledger. 2. The user invokes `dream forget `. 3. The active entry is removed, but identif ...[truncated 940 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (20)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs immediate writes to MEMORY.md and daily journal files during live conversation, without requiring explicit user awareness or consent at the point of capture. This creates a strong risk of silently persisting corrections, project details, and other personal context that the user may have intended only for the current interaction.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Scheduled silent distillation modifies persistent memory in the background with no user-facing notification. In the context of a memory skill handling personal data, autonomous silent updates increase privacy risk and reduce the user's ability to audit what was retained, compressed, archived, or resurfaced.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

Executing deletion immediately with no confirmation is unsafe because semantic matching can select the wrong entries, leading to unintended removal of memory records. In this skill, the danger is amplified by the misleading partial-delete model: active entries may be removed instantly while archival copies remain preserved, producing both data loss and privacy confusion.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This design explicitly preserves 'forgotten' data in a permanent archive and supports later resurfacing through re-emergence and wakeup flows. That makes the context more dangerous than ordinary memory retention because it defeats user expectations around deletion and can cause previously removed personal data to be disclosed again in later interactions.

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 · Skill.md (reported line 35)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.

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

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Using review as a trigger phrase is overly broad and likely to fire during ordinary conversation unrelated to memory management. In this skill, accidental activation is more dangerous because it can initiate persistent writes and distillation behavior on personal data without clear intent from the user.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger condition for requests to index content into Obsidian is ambiguous and unconstrained, so many normal requests about notes or links could be interpreted as authorization to persist content. Because indexing is tied to long-term storage and may also write preference signals into journal memory, ambiguity increases the risk of unintended retention of sensitive user data.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill directs retention of user-provided information across conversations and automatic resurfacing into MEMORY.md with limited substantive minimization controls. While memory features are expected to persist some context, the described behavior is broad enough to capture personal details and preference signals without clear scope boundaries, retention limits, or consent checkpoints.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documented forget flow is internally contradictory: it promises removal from active memory, but explicitly preserves the same information in a permanent ledger and can later reintroduce it via the re-emergence mechanism. That creates a deceptive deletion model where users may believe data is forgotten when it is still retained and potentially resurfaced, undermining privacy expectations and consent.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
95% confidence
Finding

The skill authorizes an autonomous destructive action—semantic deletion of memory entries—without confirmation or bounded review. In a system handling persistent user context, this is risky because imperfect matching or ambiguous requests can cause unintended state changes that the user did not specifically approve.

Content

Scanner excerpt · Skill.md (reported line 267)May include surrounding context.

md
### `dream forget <description>` — Remove from Memory

Semantic search in `memory/YYYY-MM-DD.md` and MEMORY.md for matching entries and remove them.
No confirmation required — executes immediately.

**Re-emergence mechanism:**
On removal, write the entry summary to `meta/removed-entries.json` along with removal timestamp and content hash.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script intentionally implements append-only archival behavior in ledger.md and ledger-index.json, and its own header explicitly states archived content is 'never deleted'. That creates a real privacy and data-retention risk because user content may be permanently preserved even after the user expects it to be removed from active memory, with no consent gate, warning, retention limit, or deletion workflow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The removed-entry tracking feature stores summaries, hashes, and timestamps for content that was supposedly removed from MEMORY.md. This undermines deletion expectations and can preserve sensitive themes or identifiers after removal, again without any explicit warning, consent, or documented retention boundary.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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 · dream-tools.sh (reported line 501)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
98% confidence
Finding

The skill explicitly states that archived memories are preserved forever, remain searchable, and can be resurfaced after being forgotten, creating a strong data retention and redisclosure risk. In this context, the danger is amplified because the content concerns user memory and personal context, which can include sensitive information users expected to age out or be removed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README advertises silent nightly distillation at 03:30 with no user-facing warning that the skill will automatically read memory files, rewrite MEMORY.md, append data to ledger.md, and update tracking metadata. In a memory-management skill, undisclosed autonomous processing increases privacy risk because users may not realize their data is being persistently transformed and retained without an interactive prompt.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Using the bare trigger phrase review creates a high chance of accidental activation during ordinary conversation, causing the skill to run file-reading and file-writing actions without clear user intent. In this skill's context, execution can modify MEMORY.md, append to a permanent archive, and update metadata, so an unintended trigger has privacy and integrity consequences beyond a harmless response.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

Documenting dream forget as removing content only from active memory while preserving it in the permanent archive undermines user-directed deletion and can mislead users into believing data was actually forgotten. This is especially dangerous for a memory skill because users may invoke forget for sensitive personal information, yet the data remains stored and searchable.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

dream status is described as 'Read-only Meta, Low IO,' yet the sample output includes MEMORY.md: N chars / 18,000 limit and Permanent archive: N records, which normally require inspecting MEMORY.md and ledger or their indexes unless separate counters are maintained elsewhere. This conflicts with the later IO principle that status 'never touches ledger or MEMORY.md body.'

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language trigger what do you remember about me is broad and conversational, so it may be matched when the user is asking a general question rather than intentionally invoking a privileged memory feature. Because this command reveals the current MEMORY.md snapshot, accidental activation can disclose sensitive personal data present in active memory.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.