T02 · Agent Memory Poisoning
- Location
SKILL.md:65- Finding
Persistent Agent Memory Can Be Poisoned with Untrusted Contract Rules
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This contract-drafting skill is mostly purpose-aligned, but it asks the agent to make automatic environment/login changes and has broad persistence and file-write behavior that should be reviewed before installation.
Install only in an isolated or trusted workspace. Do not let it automatically install global packages, complete login flows, use external search, or write permanent memory unless you have explicitly approved those actions. Review generated contracts and auxiliary JSON/Markdown outputs for sensitive business data, and avoid attacker-controlled template paths or output filenames.
SKILL.md:65Persistent Agent Memory Can Be Poisoned with Untrusted Contract Rules
references/word-plugin-setup.md:8Automatic Installation of Unpinned Global Packages and Plugins
scripts/contract_runner.py:643Unvalidated Output Filename Allows Writes Outside the Output Directory
The README instructs the agent to automatically check for, install, and prepare login state for a Word plugin and ClawHub environment, but does not require explicit user confirmation before changing the runtime environment. In an agent setting, this can lead to unauthorized package installation, account/session manipulation, or unintended networked actions that expand the attack surface beyond simple document drafting.
The skill directs the agent to read workspace files, write JSON specs and outputs, inspect memory files, and potentially invoke external tooling, but it does not declare any explicit tool/permission scope. This creates an over-broad execution surface where a host agent may grant more file or environment access than is necessary, increasing the risk of unintended data exposure or unsafe writes.
The skill instructs the agent to persist company introductions and rules into MEMORY.md or memory/ for future reuse, but it provides no requirement to obtain explicit user consent or warn about long-term retention. Because contract drafting commonly involves sensitive corporate data, this can lead to silent retention of confidential business information beyond the immediate task.
The entire skill requirements document is written in Chinese and presents the operational guidance only in that language, with no indication that users may choose another language or that the locale restriction is required for a China-specific or Chinese-only workflow. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.
The title and all instructions are written exclusively in Chinese, beginning with '输入规则', and the drafting guidance assumes Chinese-language contract generation. There is no indication that the user may choose another language or that this is a region-specific constraint, which can violate language/locale policy requirements.
The skill instructs the agent to use third-party search tools to gather company information and to write user-requested versions into permanent memory. This expands the data flow beyond contract drafting, creating avoidable privacy, data retention, and external disclosure risks—especially because company descriptions and contracting context may contain sensitive business information or unverified third-party data.
The file consistently requires outputs and filenames in Chinese, including Chinese-only artifact names like 未决事项清单.md and <模板标题>_草稿.docx, but it does not provide any user opt-in or alternative locale handling. Under the policy, forcing a specific language or locale without choice is a natural-language policy violation unless the constraint is explicitly justified.
The entire markdown file is written in Chinese and presents the skill guidance only in that language, with no indication that users may choose another language or that the skill is intended exclusively for a Chinese-speaking or China-specific context. Under the language/locale policy, imposing a single language without opt-in can be a natural-language policy violation.
The document explicitly instructs the agent to automatically modify the host environment by installing global packages, checking authentication state, prompting login, and installing a plugin before performing its core task. In an agent skill context, these steps can trigger unintended system changes and authentication actions without clear user consent, increasing the risk of supply-chain exposure, privilege misuse, and surprising side effects on the user's machine.
The script generates and searches for Chinese-only headings, labels, and note content throughout the document workflow, effectively forcing a single language/locale. There is no natural-language indication that this skill is region-specific or any mechanism for user opt-in to a Chinese-only output mode.
The skill writes contract data and derived metadata to several local files, including a draft document, markdown note, run summary, and validation report. Because contracts commonly contain sensitive party identities and business terms, this creates a clear confidentiality risk if outputs are stored in shared, synced, or weakly permissioned workspaces without prominent disclosure or minimization.
The README consistently mandates Chinese-language prompts and outputs such as 未决事项清单.md and Chinese contract fields, but does not state that the skill is region-specific or offer the user a language/locale option. This can constitute a natural-language locale policy issue because the skill appears to force a specific language by default.
The entire skill content, including operational instructions and outputs, is specified only in Chinese, and it names outputs such as '未决事项清单.md' without any indication that the user can choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is explicitly justified.
The dependency specification uses a broad version range for python-docx (>=1.1,<2) rather than pinning an exact version, which makes it impossible to verify from this file alone which release will actually be installed in different environments. Because this skill processes .docx templates, an XML-parsing library with historical XXE advisories increases risk if a vulnerable or regressed version is resolved, especially when handling untrusted documents.
The manifest describes generating contract drafts from a Word template and structured business data. In addition to processing the provided spec and template, the code inspects ~/.openclaw/openclaw.json and environment variables such as OPENCLAW_AGENT_ID to discover agent identity and workspace context, which is auxiliary platform introspection rather than an obvious requirement of document drafting.
The runner accepts absolute template paths and can resolve caller-controlled relative paths against multiple base directories, allowing the skill to open arbitrary local .docx files rather than a fixed approved template set. In an agent setting, this expands file-read scope beyond the stated contract-drafting purpose and could expose unrelated local documents if an attacker can influence the job spec or CLI arguments.
No suspicious patterns detected.