Back to skill

Security audit

AutoDream Memory

Security checks for vulnerabilities and agentic risk

Overview

The skill is a real memory organizer, but it can rewrite persistent memory and set up recurring behavior while some promised safety controls are missing or inaccurate.

Review carefully before installing. Use only on a workspace where MEMORY.md and session-derived memory can be rewritten, and avoid enabling the setup script until backups, dry-run behavior, locking, and the scheduler path are corrected. I found no runtime network exfiltration or malicious payload, but the memory mutation and persistence behavior justify Review.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/autodream_cycle.py:507
Finding

Dry-Run Mode Destructively Overwrites Persistent Memory Without Backup or Locking

Content
View full analysis

Vulnerability Details

File Location: scripts/autodream_cycle.py, lines 507-509 and 678-683
Vulnerability Type: Dry-run violation, unsafe persistent-file replacement, and missing concurrency safeguards
Risk Level: Medium

Vulnerable Code

python
# scripts/autodream_cycle.py:507-509
# Write MEMORY.md
memory_md.parent.mkdir(parents=True, exist_ok=True)
memory_md.write_text("\n".join(lines), encoding="utf-8")
python
# scripts/autodream_cycle.py:678-683
# Phase 4: Prune and Index
prune_result = phase4_prune_and_index(workspace, consolidation)

# Generate report
if not args.dry_run:
    report_path = write_report(
        workspace, consolidation, orientation, prune_result
    )

The command-line option is explicitly described as non-writing:

python
# scripts/autodream_cycle.py:639-640
parser.add_argument(
    "--dry-run",
    action="store_true",
    help="Trial run without writing files"
)

Technical Analysis

The dry-run condition is checked only after phase4_prune_and_index() has returned. That phase unconditionally replaces the workspace's MEMORY.md, so --dry-run suppresses report and state files but does not suppress the primary persistent-memory modification.

The replacement is also performed directly with Path.write_text(). It does not:

  • Create the backup promised by the Skill documentation and configuration.
  • Acquire the lock promised by the Skill documentation.
  • Write to a temporary file and atomically replace the destination.
  • Preserve entries found only in the existing MEMORY.md.

The consolidation input is collected from memory/*.md and memory/topics/*.md, while the existing MEMORY.md is only read to obtain its line count. Consequently, entries that exist exclusively in MEMORY.md can disappear when the replacement index is generated.

The issue does not require code execution, elevated privileges, or an external attacker. It is triggered through a documented command and affects any ` ...[truncated 1486 chars]

Remediation
View remediation

Remediation Suggestions

  1. Enforce dry-run mode before every mutation:

    python
    if not dry_run:
        memory_md.write_text(output, encoding="utf-8")
    

    Prefer passing a dry_run argument into every phase that may modify the filesystem.

  2. Separate computation from persistence:

    • Build the proposed MEMORY.md entirely in memory.
    • Return the proposed content and change summary.
    • Perform all writes in one guarded commit stage only when dry-run is disabled.
  3. Back up the original file before replacement:

    • Create memory/autodream/backup/.
    • Use a timestamped, collision-resistant backup filename.
    • Verify that the backup was written successfully before modifying the original.
  4. Use atomic replacement:

    • Write the complete output to a temporary file in the destination directory.
    • Flush and synchronize it where appropriate.
    • Replace MEMORY.md with os.replace() only after successful completion.
    • Clean up temporary files on failure.
  5. Implement exclusive locking:

    • Acquire a workspace-specific lock before reading and modifying persistent memory.
    • Reject or safely wait for concurrent runs.
    • Release the lock through a finally block.
  6. Preserve index-only content:

    • Include existing MEMORY.md entries in consolidation, or
    • Explicitly identify proposed removals and require confirmation before deleting them.
  7. Add regression tests that verify:

    • --dry-run produces no filesystem changes.
    • A failed write leaves the original file intact.
    • Concurrent runs cannot overwrite one another.
    • Backups are created before replacement.
    • Entries found only in MEMORY.md are preserved or explicitly reported.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (27)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented purpose is memory consolidation, but the skill also instructs setup of scheduled execution and writes scheduler/config-related artifacts beyond direct memory cleanup. This mismatch is dangerous because users may authorize a seemingly narrow housekeeping skill that actually establishes persistence or modifies operational configuration, which expands both attack surface and blast radius.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script stores extracted and consolidated natural-language content into MEMORY.md and multiple JSON/Markdown artifacts, creating several secondary copies of potentially sensitive session-derived data. Because the skill's purpose is memory consolidation, this context makes the behavior expected, but also more dangerous: it concentrates and republishes user content into durable, easy-to-read files that may be accessed by other tools or users.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The report claims a 'read-only mode' under security constraints, but elsewhere it instructs users to run setup scripts that configure scheduled tasks and references creation/publication of artifacts. This inconsistency can mislead operators into trusting the skill as non-invasive when it actually performs system-level changes, increasing the risk of unintended persistence or broader file/system modification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The report includes install and execution commands, including a scheduler setup step, without clearly warning that the skill performs periodic/background activity and writes reports/files to the workspace. Users may run the commands expecting a one-time maintenance action, but instead enable persistent automation that modifies memory files over time, which can lead to unintended data changes or privacy/operational issues.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README explicitly describes pruning, merging, and deleting memory entries and notes backups, but it does not provide a clear warning that running the skill modifies and may remove user data. In a memory-management skill, this increases the chance of unintended destructive use because users may invoke setup or force-run commands without understanding that historical information can be deleted or condensed irreversibly from primary files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document describes automatic triggering, consolidation, pruning, and deletion, but does not prominently warn users that the skill will modify memory files on its own schedule. In the context of an autonomous memory-management skill, insufficient disclosure of self-initiated destructive changes can lead to unexpected alteration or removal of important data.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The release notes present contradictory safety claims: they state deletion is backed up under '安全约束', but later list backup support as future work. For a skill that automatically consolidates and removes memory entries, this inconsistency can mislead users into trusting destructive behavior that may not actually be recoverable, increasing risk of silent data loss.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · RELEASE_STATUS.md (reported line 80)May include surrounding context.

方式 3: API 发布

bash
curl -X POST https://api.clawhub.com/api/v1/skills/publish \
  -H "Authorization: Bearer <TOKEN>" \
  -F "skill=@/tmp/autodream-v1.0.0-release.tar.gz"

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · COMPLETION_REPORT.md (reported line 187)May include surrounding context.

使用文档:skills/autodream/README.md 发布指南:skills/autodream/PUBLISH_GUIDE.md 发布说明:skills/autodream/RELEASE_v1.0.0.md 技能定义:skills/autodream/SKILL.md

text

---

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · RELEASE_STATUS.md (reported line 160)May include surrounding context.

使用文档:skills/autodream/README.md 发布指南:skills/autodream/PUBLISH_GUIDE.md 发布说明:skills/autodream/RELEASE_v1.0.0.md 技能定义:skills/autodream/SKILL.md

text

---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The quick-start section instructs users to run a setup script that installs a recurring cron job, but it does not clearly warn that this creates ongoing scheduled execution on the host. That omission can mislead users into granting persistence without informed consent, which is a meaningful security concern for an agent skill that performs automated file operations in a workspace.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill advertises file-reading and file-writing behavior but declares no explicit tool scope such as permissions or allowed-tools. In an agent ecosystem, this creates an authorization ambiguity where the runtime may grant broader file access than users expect, increasing the chance of unintended modification of workspace files or memory data.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The docstring states the function detects stale entries by checking whether referenced files no longer exist. But the regex at L129-L130 uses a capturing group, so re.findall returns only the extension like 'py' or 'md'; the subsequent existence check therefore tests incorrect paths and does not actually verify the referenced file path as documented.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This phase explicitly scans session logs for user corrections, saved memories, and decisions, extracting message content into an internal signal set. In a memory-management skill, collecting natural-language session content is contextually expected, but without minimization and consent controls it still creates a privacy and data-retention risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest and module docstring describe organizing MEMORY.md and memory files, including deduplication, merging, and removing stale entries. However, phase 3 only computes a consolidated in-memory entry set, and the main flow later saves that result to auxiliary JSON files; no code writes the cleaned entries back to the source files under memory/ or memory/topics, so the actual memory files are not consolidated as claimed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script unconditionally rewrites MEMORY.md during normal execution, which can overwrite curated memory content and create unintended persistence changes without a clear confirmation or backup step. In an agent skill that processes user/session-derived data, silent mutation of a primary memory file increases the risk of integrity loss and accidental retention of sensitive content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script persists consolidated entries, pruned entries, merged entries, state, and a markdown report to disk, all derived from memory/session content. This broadens the data-retention surface and can expose sensitive conversational material in additional files that users may not realize are being created.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring says it 'ensures OpenClaw cron configuration exists,' implying the cron job is actually established. In practice, the code merely writes a simplified config file and even notes that the user must manually run 'openclaw cron add' afterward, so the stated effect contradicts the implemented 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 docstring, argument help text, comments, and user-facing output are all written in Chinese, which imposes a specific language on users. The file does not provide any opt-in, fallback, or justification that this skill is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a sub-agent that periodically organizes memory files, deduplicates, merges, and removes stale entries. This file does not perform any memory consolidation work; instead it creates a cron configuration file to schedule future execution, which is a separate operational/setup function not reflected in the manifest description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script modifies persistent configuration and then immediately executes the AutoDream task against the computed workspace without any confirmation, dry-run default, or clear warning about side effects. In this skill’s context, the executed task is specifically designed to reorganize and delete stale memory entries, so an accidental invocation or incorrect workspace path could cause unintended file modifications or data loss.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The checklist states that SKILL.md must contain an English description, which imposes a specific language requirement in natural-language guidance. This appears again later as a requirement, and the file does not present it as an optional user choice or clearly justified region-specific exception.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The note says ClawHub requires an English description and frames it as a mandatory publishing condition. Because this is a natural-language locale requirement and the file does not offer language choice or clearly scope the constraint beyond platform metadata, it matches the policy-violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README presents the skill description entirely in Chinese and does not indicate that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

All user-facing natural-language content in this file is written in Chinese, with no indication that other languages are supported or that this is a region-specific skill. Under the stated policy, forcing a specific language without user opt-in is a potential locale/language policy issue.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.