T02 · Agent Memory Poisoning
- Location
scripts/import_markdown_to_memos.py:21- Finding
Unvalidated Markdown Content Can Poison Persistent Agent Memory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a disclosed memory-migration helper, but it can rewrite plugin configuration and write persistent agent memory without adequate confirmation, backups, or rollback safeguards.
Install only if you are intentionally migrating from memory-lancedb-pro to memos-local-openclaw-plugin and are comfortable reviewing the scripts first. Before running anything, manually back up your OpenClaw config, memory markdown files, and memos SQLite database; replace hard-coded paths carefully; do a dry run or inspect parsed records; and avoid importing untrusted markdown files into persistent agent memory.
scripts/import_markdown_to_memos.py:21Unvalidated Markdown Content Can Poison Persistent Agent Memory
scripts/remove_memory_lancedb_pro.py:4Configuration File Is Destructively Rewritten Without Backup or Atomic Replacement
scripts/import_markdown_to_memos.py:5Live Memory Database Migration Lacks Backup, Schema Validation, and Idempotency
The stated purpose is memory conversion and import, but the operational content prominently includes removing plugin configuration and altering local state, which is a material behavior mismatch. This is dangerous because users or orchestration systems may invoke the skill expecting migration assistance while it also performs disruptive configuration changes that can disable components or alter persistence behavior.
The script's behavior does not match the declared skill purpose of converting memory files and importing markdown data. Instead, it silently removes the 'memory-lancedb-pro' plugin from the configuration, which can disable functionality and cause data access disruption or accidental loss of integration. In a migration-themed skill, this mismatch is especially dangerous because a user may trust it to preserve data while it performs destructive configuration changes.
The skill contains code snippets that read and write configuration files and database-backed memory data, but it declares no tool scope or permission boundaries. In an agent setting, this creates an authorization gap where the agent may perform filesystem modifications without transparent consent or least-privilege constraints.
The trigger conditions are very broad and can match generic requests about migration, markdown import, configuration changes, or plugin switching. Over-broad activation increases the chance that the skill is invoked in contexts where destructive config edits or database imports are inappropriate, leading to accidental misuse.
The skill description and instructions are written entirely in Chinese, and there is no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.
The instructions direct deletion of plugin configuration and direct insertion into a SQLite database without prominent backup, rollback, schema validation, or integrity warnings. In context, this is risky because memory migration touches persistent user data; a malformed script, regex mismatch, or schema drift could corrupt records, create duplicates, or disable the existing memory system.
All example prompts in the evals are written in Chinese, and the file provides no indication that the skill supports multiple languages or is intentionally restricted to a Chinese-speaking context. This can reflect a natural-language policy issue if the skill behavior or evaluation setup assumes a specific language without user opt-in.
This code performs persistent data writes by inserting markdown-derived content into the chunks table, which can affect user data state. The file contains no confirmation prompt, logging/print statement, or explanatory docstring/comment warning the user that content from the memory directory will be imported into the database.
The script overwrites the configuration file in place without prompting the user, creating a backup, or providing rollback safeguards. This can cause irreversible configuration damage or service disruption if the change is unintended, the file structure differs from expectations, or the script is run in the wrong environment. The surrounding skill context increases risk because users expect a safe migration workflow, not silent destructive edits.