Back to skill

Security audit

中文记忆优化 (Chinese Memory Optimizer)

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real Chinese OpenClaw memory-maintenance workflow, but it can rewrite, compress, delete, and reconfigure persistent memory without strong safeguards.

Install only if you want a Chinese-language OpenClaw memory maintenance skill and are comfortable letting it modify persistent memory files and memory behavior. Run dry-run modes first, back up memory directories yourself, avoid running it on directories writable by other users, and inspect compression results before relying on archived logs.

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

Warning
Location
add-tags.py:63
Finding

Symbolic-Link Following Allows Modification of Files Outside the Target Directory in add-tags.py

Content
View full analysis
\n" if dry_run: print(f" WOULD ADD: {tag_line.strip()}") return True, "dry run" with open(filepath, 'w', encoding='utf-8') as f: f.write(tag_line + content) ``` ### Technical Analysis The script obtains Markdown filenames from a user-supplied directory and opens each resulting path without checking whether the directory entry is a symbolic link. Python's `open()` follows symbolic links by default. Consequently, an attacker who can create entries in the target directory can place a `.md` symbolic link pointing to another user-writable file outside that directory. The script reads the linked target and then reopens it in write mode, which truncates and replaces the target with a generated tag line followed by its previous content. The generated tag can also contain content derived from the symbolic-link filename. Although the current filename filtering limits entries to names ending in `.md`, the primary security issue is the unauthorized cross-directory write. ### Attack Path 1. The attacker obtains write access to a memory projects directory that will be processed. 2. The attacker creates a symbolic link with a `.md` suffix in that directory: ```bash ln -s "$HOME/path/to/target.md" /path/to/memory/projects/attacker.md ``` 3. The victim or Agent runs: ```bash python3 add-tags.py /path/to/m ...[truncated 736 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
compress-logs.py:115
Finding

Symbolic-Link Following Allows Destructive Compression of External Files

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
compress-logs.py:145
Finding

Predictable Backup Collision Can Cause Irrecoverable Log Data Loss

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the underlying implementation is only diagnostic or advisory while the skill claims automatic optimization and maintenance, users may rely on it for remediation that never occurs or occurs only partially. That can produce unsafe assumptions about system state and lead operators to run follow-up commands without understanding the residual risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the underlying implementation is only diagnostic or advisory while the skill claims automatic optimization and maintenance, users may rely on it for remediation that never occurs or occurs only partially. That can produce unsafe assumptions about system state and lead operators to run follow-up commands without understanding the residual risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the underlying implementation is only diagnostic or advisory while the skill claims automatic optimization and maintenance, users may rely on it for remediation that never occurs or occurs only partially. That can produce unsafe assumptions about system state and lead operators to run follow-up commands without understanding the residual risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the underlying implementation is only diagnostic or advisory while the skill claims automatic optimization and maintenance, users may rely on it for remediation that never occurs or occurs only partially. That can produce unsafe assumptions about system state and lead operators to run follow-up commands without understanding the residual risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill instructs the agent to run scripts that read and modify memory files, but the manifest does not declare any explicit tool scope or permissions. That creates an authority/transparency gap: a user or runtime may not realize the skill needs filesystem write access before it edits or restructures stored memory content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill is presented as a Chinese memory optimization workflow and later instructs that new logs should use Chinese tokenization conventions and Chinese keywords separated by spaces. There is no indication that the user can opt into this locale-specific behavior or that the skill is restricted to Chinese-only environments. This can violate language/locale policy because it imposes a specific language mode by default.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill directs automatic tag insertion, log compression, archival, and index rebuilding without requiring explicit user confirmation before modifying stored memory files. In a memory-management context, these are integrity-sensitive operations that can overwrite content, alter retrieval behavior, or cause data loss if run on the wrong path or with bad heuristics.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring states that the script will automatically generate Chinese plus English keyword tags, and all user-facing usage/help text is written only in Chinese. This imposes a specific language/locale behavior without user opt-in or any documented region-specific justification, which matches the language-policy violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This shell script uses Chinese comments and user-facing messages throughout, including the deletion confirmation prompt and status output. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill manifest emphasizes diagnosing Chinese FTS5 tokenization issues, optimizing search parameters, and automatically maintaining memory files to improve recall. This script actually rewrites memory log files by deleting code blocks, truncating sections, and replacing originals with compressed content, which is a materially different behavior than search optimization or bug diagnosis.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script overwrites user log files in place after compression, which is destructive and can permanently remove information if the compression logic is too aggressive or incorrect. Although it creates a backup by default, the modification still occurs without an explicit confirmation prompt or strong warning, which is risky in an agent skill context where users may not expect irreversible content pruning.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Nearly all user-facing comments and output strings in the script are written in Chinese, with no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-only region or audience. This is a natural-language locale policy issue because it imposes a specific language on users by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module docstring and command descriptions are presented exclusively in Chinese, which imposes a language choice on users without offering an alternative or opt-in. Under the stated policy, language constraints should be optional or clearly justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring claims the compressor keeps only section titles, completed items, key findings, pitfalls, and deployment info while deleting debugging process, intermediate steps, large code blocks, and repeated content. In practice, is_valuable_line returns True for nearly all lines by default, so many undeclared line types are preserved unless they are code fences or very long lines, contradicting the stated retention policy.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.