Back to skill

Security audit

Memory Tree

Security checks for vulnerabilities and agentic risk

Overview

This looks like a legitimate memory tool, but it needs Review because it reads local memory and OpenClaw channel configuration while the documentation is inconsistent about automation, cloud use, and sharing behavior.

Install only if you are comfortable with the skill reading your OpenClaw memory files and OpenClaw channel configuration. Treat the weekly report as potentially sensitive, review the generated report and Feishu target before running any printed send command, and do not rely on the README or SECURITY claims about cron, cloud APIs, or automatic decay because those behaviors were not present in the inspected code.

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

Note
Location
scripts/memory_tree.py:221
Finding
Overbroad Access to Credential-Bearing OpenClaw Configuration## Vulnerability Details **File Location**: `scripts/memory_tree.py:30`, `scripts/memory_tree.py:221-233`, `scripts/memory_tree.py:359-371` **Vulnerability Type**: Excessive configuration access and unsafe recipient inference **Risk Level**: Low ### Complete Code Snippet ```python OPENCLAW_CONFIG = Path.home() / ".openclaw" / "openclaw.json" ``` ```python def detect_enabled_channels(): """从 openclaw.json 检测已启用的推送渠道""" config = load_json(OPENCLAW_CONFIG) channels = config.get('channels', {}) enabled = [] for name, cfg in channels.items(): if cfg.get('enabled', False): enabled.append({ 'name': name, 'config': cfg, }) return enabled ``` ```python channels = detect_enabled_channels() if channels: print(f"📡 检测到已启用渠道: {', '.join(c['name'] for c in channels)}") for ch in channels: if ch['name'] == 'feishu': chat_id = get_feishu_chat_id(ch['config']) if chat_id: print(f"\n📱 飞书推送配置:") print(f" chat_id: {chat_id}") print(f"\n💡 推送命令:") print(f" message send --target {chat_id} --file {report_file}") ``` ### Technical Analysis The `weekly` operation reads the complete `~/.openclaw/openclaw.json` file and retains the complete configuration object for every enabled channel. Local weekly-report generation does not require access to channel credentials or unrelated channel settings. Although the current implementation does not print credentials or transmit the report, retaining complete channel configuration objects unnecessarily expands the sensitive-data exposure surface. A future logging statement, exception handler, plugin, or modification could inadvertently disclose secrets stored in those objects. The code also chooses the first entry in Feishu's `groupAllowFrom` list as the suggested destination. That list is an access-control list, not necessarily an ...[truncated 1427 chars]
Remediation
## Remediation Suggestions 1. Keep weekly-report generation local by default and do not read `openclaw.json` unless the user explicitly requests sharing. 2. Require an explicit `--share` and `--target` argument before preparing or performing external delivery. 3. Extract only the minimum required values instead of retaining each complete channel configuration object. 4. Never place authentication tokens, secrets, or complete configuration mappings into returned data structures. 5. Do not infer a report recipient from `groupAllowFrom`; treat authorization lists and delivery destinations as separate concepts. 6. Display the selected recipient and require explicit confirmation before any future transmission feature. 7. Add tests confirming that local report generation does not access channel credentials or perform network operations.

other

Note
Location
README.md:25
Finding
README Describes Nonexistent Persistence and Cloud-Backend Behavior## Vulnerability Details **File Location**: `README.md:3`, `README.md:25-28`, `README.md:82-100` **Vulnerability Type**: Misleading security and operational documentation **Risk Level**: Informational ### Complete Documentation Snippets ```markdown **装上就自动运行**:每天衰减、每周归档,无需任何操作。 ``` ```markdown ### 1. 小白友好 - 不用改配置文件 - 不用手动设置 crontab - 一句话初始化,之后全自动 ``` ```markdown ## 其他的全自动 装好初始化后: - 每天凌晨 3 点自动衰减 - 每周自动归档死亡记忆 - 搜索引擎自动检测最佳后端 **你不用管它,它自己会跑。** ``` ```markdown ## 搜索后端 自动检测优先级: 1. **Ollama**(本地,免费,隐私)— 默认 2. **智谱 / OpenAI API**(云端) 3. **关键词搜索**(零依赖 fallback) ``` ### Technical Analysis The README claims that installation enables automatic daily decay, weekly archival, cron-based operation, semantic search, Ollama integration, and cloud API backends. None of those behaviors exist in the audited `scripts/memory_tree.py`. The actual command set is limited to `weekly`, `search`, `mark`, and `visualize`. The implementation contains no crontab modification, setup command, scheduler registration, Ollama integration, cloud API client, API-key lookup, automatic decay, or automatic archival. The static pre-scan persistence warning is therefore caused by documentation text rather than an implemented persistence mechanism. `T06: System Persistence` is not confirmed. ### Attack Path There is no executable attack path for persistence or cloud exfiltration in the audited project. The practical failure path is documentation-driven: 1. A user installs the Skill based on the README. 2. The user assumes scheduled decay and archival are active. 3. The Skill never registers a scheduled task or performs those operations. 4. The user may rely on retention, archival, or privacy behavior that does not exist. 5. Security reviewers may also incorrectly conclude that the package modifies crontab or communicates with cloud services. ### Impact Assessment No persistence, network access, or additional privilege is obtained by the executable. The impact is inaccurate user consent, o ...[truncated 212 chars]
Remediation
## Remediation Suggestions 1. Rewrite the README to match version 2.0.0 and the actual four supported commands. 2. Remove all claims concerning crontab, automatic decay, automatic archival, Ollama, cloud APIs, and semantic search unless those features are implemented. 3. State explicitly that `weekly` must be invoked manually unless scheduling is configured independently by the user. 4. Clarify that the Skill only prints a suggested Feishu send command and does not automatically transmit reports. 5. Add documentation checks to the release process so behavior claims are validated against the current CLI and source code.

other

Note
Location
SECURITY.md:12
Finding
Security Statement Describes Obsolete Cron and Cloud-Exfiltration Features## Vulnerability Details **File Location**: `SECURITY.md:12-34`, `SECURITY.md:41-51` **Vulnerability Type**: Inaccurate security disclosure **Risk Level**: Informational ### Complete Documentation Snippet ```markdown ### 2. Cloud API Fallback If `ZHIPU_API_KEY` or `OPENAI_API_KEY` environment variables are set, MEMORY.md content will be sent to cloud embedding endpoints. **Mitigation:** - To stay fully local, ensure Ollama is running and DO NOT set cloud API keys - Use `python3 memory_tree.py config backend keyword` to force local keyword mode - The skill auto-detects backends and prefers local Ollama when available ### 3. Cron Job Creation The `setup` command creates persistent cron jobs for automatic indexing/decay/cleanup. **Mitigation:** - Review what the setup script writes to crontab before running - You can also run index/decay/cleanup manually without cron - Cron jobs are user-level (not system-wide) and can be removed anytime ## What This Skill Does - ✅ Reads `~/.openclaw/workspace/MEMORY.md` - ✅ Writes to `~/.openclaw/workspace/memory-tree/data/` (confidence, embeddings, archive) - ⚠️ May send memory content to cloud embedding APIs (if configured) - ✅ Creates cron jobs (only when you run `setup`) ``` ```markdown If you want **strictly local** operation: 1. Run `ollama serve` with an embedding model 2. Don't set `ZHIPU_API_KEY` / `OPENAI_API_KEY` 3. Verify with `python3 memory_tree.py config show` ``` ### Technical Analysis The security statement appears to describe an earlier implementation rather than the audited version 2.0.0. The current script has: - No `setup` command. - No `config` command. - No HTTP or cloud API implementation. - No reads of `ZHIPU_API_KEY` or `OPENAI_API_KEY`. - No Ollama integration. - No subprocess or shell invocation. - No crontab modification. - No indexing, decay, or cleanup commands. Consequently, the document both warns about risks that are absent and recommends mitigation commands that cannot be executed. T ...[truncated 1001 chars]
Remediation
## Remediation Suggestions 1. Replace the obsolete security statement with an assessment of the current version 2.0.0 implementation. 2. Remove references to cloud API keys, Ollama, `setup`, `config`, indexing, decay, cleanup, and cron creation. 3. Document the actual file access performed by each command. 4. Explain that weekly reports may contain sensitive memory summaries and remain local unless a user manually executes the printed send command. 5. Document access to `~/.openclaw/openclaw.json` and the associated least-privilege concern. 6. Add a version identifier and last-reviewed commit to the security statement to prevent future version drift.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (16)

Missing User Warnings

High
Confidence
94% confidence
Finding
The skill states that weekly reports automatically detect and push to enabled channels such as Feishu, but it does not prominently warn users that local memory content may be transmitted externally. This creates a real data exfiltration and privacy risk because summaries could include sensitive information and be sent off-host without informed consent at invocation time.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The README emphasizes that the skill runs automatically, decays memories daily, and archives them weekly, but it does not clearly foreground the consequences for retained data or reversibility. Users may enable the skill without understanding that stored information will be continuously modified over time.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrase for recalling memories is described as ordinary conversational text, which makes accidental invocation likely during normal chat. In an agent skill, broad triggers can cause unintended access to stored memory content or launch actions the user did not mean to perform.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The README states that cloud APIs may be used as a fallback for semantic search, but it does not explicitly warn that user memory content or search queries could be transmitted off-device. Because this skill handles potentially sensitive personal memory data, silent fallback to remote providers materially increases privacy and data-exposure risk.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The initialization phrase is also a natural-language sentence that could be said casually or quoted, increasing the chance the skill installs schedules or starts background behavior without informed intent. Initialization is especially sensitive because it enables persistent automation and data modification.

Lp3

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding
The skill advertises capabilities that imply reading and writing local files, but the manifest does not declare any tool scope or permissions boundaries. That creates a least-privilege failure: users and the host agent cannot easily tell what filesystem access is expected, increasing the chance of overbroad access or unsafe execution assumptions.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The description says the skill can be used by casually 'saying a sentence,' which makes activation criteria overly broad and likely to overlap with normal conversation. In an agent environment, ambiguous triggers can cause unintended execution of memory actions, including storing or searching data without clear user intent.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The description and invocation phrases are presented only in Chinese, including the user-facing command examples, with no indication that another language is supported or that Chinese-only use is intentional for a region-specific purpose. This can violate language/locale policy when users are not given an opt-in choice.

Vague Triggers

Medium
Confidence
95% confidence
Finding
Examples like '生成周报', '搜索记忆 关键词', and especially '记住这个' are common conversational phrases with no scope constraints or confirmation requirements. That increases the risk that routine chat content is interpreted as a command, leading to unintended persistence of data or execution of reporting behavior.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The description claims the skill is 'fully automatic' and broadly advertises capabilities like weekly report generation, permanent memory marking, and keyword search without clarifying triggers, boundaries, or required user consent. In a memory-oriented skill, vague automation language can mislead users into thinking the skill may autonomously store, process, or summarize data beyond explicit requests, increasing the risk of unintended data handling.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The module description and all user-facing strings are written exclusively in Chinese, indicating the skill is intended to operate in a single language. There is no natural-language indication that users may choose another language or that the skill is specifically limited to a Chinese-only deployment context.

Description-Behavior Mismatch

Medium
Confidence
92% confidence
Finding
The skill goes beyond its advertised memory-management scope by reading the user's external OpenClaw channel configuration and discovering enabled messaging targets. Even though it only prints a suggested push command instead of sending automatically, this still exposes integration metadata and creates an unexpected path for sharing generated memory reports containing potentially sensitive content.

Ssd 3

Medium
Confidence
93% confidence
Finding
The weekly report consolidates summaries of current memories, permanent memories, and archived/forgotten items into a single artifact, then surfaces a ready-to-run external sharing command. This increases the chance of accidental disclosure of sensitive memory content because the tool makes aggregation and onward sharing easier without explicit content review, redaction, or confirmation.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The code prints enabled channel names and exposes the Feishu chat ID derived from local configuration. Chat IDs and integration configuration are sensitive metadata; revealing them on stdout can leak internal routing information to logs, terminals, or upstream agents and is not necessary for core memory search/mark/report functionality.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
The README consistently presents the skill description, invocation examples, and user instructions only in Chinese. Because no user language option or justified region-specific constraint is documented, this appears to impose a specific language without opt-in.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The description is written entirely in Chinese and presents the skill behavior in that locale without indicating multilingual support or user choice. While not inherently dangerous, forcing a specific language can impair informed consent and user understanding of sensitive functions such as memory retention and report generation, especially when the skill handles potentially personal data.

Static analysis

No suspicious patterns detected.