Back to skill

Security audit

Ask To Remember

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent memory-capture purpose, but it persistently changes agent behavior and stores user-derived preferences and replies with limited user-facing consent or controls.

Install only if you are comfortable with a skill that proactively asks preference questions, modifies agent memory/control files, may inject rules at startup, and keeps plaintext logs of questions and replies. Review and limit the hook/AGENTS.md behavior, and prefer explicit approval before any MEMORY.md write.

Vulnerability Patterns
  • 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
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
hooks/openclaw/handler.js:9
Finding

Persistent Bootstrap Instruction Hijacking

Content
View full analysis
/AGENTS.md` 中是否已包含 `## Ask-to-Remember` 章节。如果已包含(无论是手动写入还是通过 Hook 自动注入),跳过本步骤。如果没有,将以下内容追加到 AGENTS.md 的 `## Memory` 章节末尾(如果没有 Memory 章节,追加到文件末尾): ```markdown ## Ask-to-Remember `ask-to-remember` skill proactively captures reusable user preferences. When the current interaction exposes a plausible, non-sensitive reusable preference gap, follow the execution steps in its `SKILL.md`. Only trigger in the human's direct main session. ### Pending Question Resolution Check `atr-state.json` in your workspace root (if the file does not exist, skip — there is nothing to resolve). If `pendingQuestion` is not `null`, resolve it **before** doing anything else: ``` ``` `hooks/openclaw/handler.js:9-46`: ```javascript const ATR_CONTENT = `## Ask-to-Remember \`ask-to-remember\` skill proactively captures reusable user preferences. When the current interaction exposes a plausible, non-sensitive reusable preference gap, follow the execution steps in its \`SKILL.md\`. Only trigger in the human's direct main session. ### Pending Question Resolution Check \`atr-state.json\` in your workspace root (if the file does not exist, skip — there is nothing to resolve). If \`pendingQuestion\` is not \`null\`, resolve it **before** doing anything else: - **Answered** (user gave a clear preference) → extract the reusable fact, derive a short topic label from the question and reason (e.g. \`周末行程风格\`), append \`## [ATR] \` to MEMORY.md, clear \`pendingQuestion\`, append \`{ "question": "...", "askedAt": "...", "outcome": "answered" }\` to \`askedQuestions\` - **Refused** (e.g. \`别问了\`, \`别问这种\`) → clear \`pendingQuestion\`, add a short normalized topic label to \`refusedTopics\`, ...[truncated 4291 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:25
Finding

Persistent Memory Poisoning Through Inferred User Preferences

Content
View full analysis
` to MEMORY.md, clear `pendingQuestion`, append `{ "question": "...", "askedAt": "...", "outcome": "answered" }` to `askedQuestions` - **Refused** (e.g. `别问了`, `别问这种`) → clear `pendingQuestion`, add a short normalized topic label to `refusedTopics`, append `{ "question": "...", "askedAt": "...", "outcome": "refused" }` to `askedQuestions`, do not write memory - **Vague** (e.g. `都行`, `看情况`) → clear `pendingQuestion`; do not write memory; do not add to `askedQuestions` - **Ignored** (completely unrelated to the question) → clear `pendingQuestion`; do not write memory; do not add to `askedQuestions`; increment `ignoredCount` for the topic (see Ignored cooldown below) **Disambiguation priority:** If the user's wording can naturally be read as confirming one of the options, prefer **Answered**. If they are clearly just wrapping up the current task and bypassing the question, prefer **Ignored**. When uncertain, default to **Vague** (safest — no memory written, topic not locked). **Ignored cooldown:** Track consecutive ignored count per topic. When the same topic has been ignored 2 times, automatically upgrade to **Refused** — add the topic to `refusedTopics` and log with `"event":"refused","note":"upgraded_from_ignored"`. ``` `SKILL.md:62-81`: ```markdown **前置条件检查表**——全部通过才继续,否则跳过并写 skipped 日志(见步骤 4): | 条件 | 不通过时 reason | |------|----------------| | `pendingQuestion` 为 `null`(Phase B 会在本轮优先收口,此处是同一个 gate 的 Phase A 侧) | `pending` | | 目标话题不在 `refusedTopics` 中 | `refused` | | `/MEMORY.md` 中尚未记录该信息 | `already_know ...[truncated 2738 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:39
Finding

Plaintext Logging of Raw User Replies Without Retention Controls

Content
View full analysis
/atr-log.jsonl` 追加一行。只在**提问**或**明确跳过**时写日志。 **成功提问:** ```json {"time":"ISO时间戳","phase":"A","event":"asked","question":"你问的问题","reason":"复用价值说明"} ``` **跳过:** ```json {"time":"ISO时间戳","phase":"A","event":"skipped","reason":"pending|refused|duplicate|already_known|not_reusable"} ``` ``` ### Technical Analysis The workflow records the original preference question and the user’s complete reply in `atr-log.jsonl`. It does not define redaction, field-length limits, restrictive file permissions, encryption, retention periods, rotation, or deletion. Even if the generated preference question is intended to be non-sensitive, the user’s next message may contain unrelated personal, confidential, credential, or business information. The rule records that response as the `answer`, creating an additional plaintext copy in the workspace. The append-only design can also produce unbounded retention and file growth. Any process, extension, backup system, or later agent with workspace read access may be able to retrieve the logged content. ### Attack Path 1. The skill stores a pending preference question. 2. In the next turn, the user responds to the question while also including unrelated sensitive information. 3. The Phase B rule copies the user’s reply into the `answer` field of `atr-log.jsonl`. 4. The file persists without a defined expiration or rotation policy. 5. Another process or agent with workspace access reads the log and obtains the copied c ...[truncated 586 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger condition is intentionally broad: it says to activate whenever there is a plausible reusable gap and not to skip just because the task is clear or completed. In context, that broad trigger is dangerous because it increases the frequency of unsolicited memory capture attempts and the associated persistent writes/logging defined later in the skill.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 20)May include surrounding context.

md
ible, non-sensitive reusable preference gap, follow the execution steps in its `SKILL.md`. Only trigger in the human's direct main session.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The operational instructions are written to enforce Chinese-language handling and examples without any user-language negotiation. This is primarily a safety/usability issue rather than a direct exploit, but it can cause the agent to behave unexpectedly, obscure consent, and reduce the user's understanding of what is being stored or asked.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly instructs the agent to append a new persistent prompt section into AGENTS.md so the behavior is automatically loaded in future sessions. This is effectively self-installing persistent instruction injection, which can change the host agent's control plane beyond the declared scope of the skill and create a durable foothold for future behavior shaping.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill directs the agent to modify persistent workspace files such as AGENTS.md, MEMORY.md, atr-state.json, and atr-log.jsonl, which goes beyond a simple conversational follow-up. Persistent file writes alter future agent behavior and create durable records of user interactions, increasing privacy and integrity risk if the skill triggers too broadly or without explicit consent.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill instructs persistent logging of questions, outcomes, and user replies, plus storage of reusable preferences in MEMORY.md in plain-language form. Plain-text cross-session records increase privacy risk, can expose behavioral metadata, and may be accessible to other tools or users with workspace access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill stores pending questions, refused topics, asked question history, ignored counts, and memory entries across conversations. Even if intended for UX improvement, this exceeds narrowly scoped preference capture and creates a cross-session behavioral profile that can reveal interaction patterns and consent signals in ways users may not expect.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
95% confidence
Finding

The hook installation instructions copy files into a managed hooks directory under ~/.openclaw so the behavior persists across agent restarts. That is a session-persistence mechanism: once installed, the skill can auto-inject itself on future launches, materially expanding its reach and making removal or auditing harder.

Content

Scanner excerpt · SKILL.md (reported line 138)May include surrounding context.

将 hooks/openclaw/ 目录下的文件复制到 managed hooks 目录:

bash
mkdir -p ~/.openclaw/hooks/ask-to-remember
cp hooks/openclaw/HOOK.md hooks/openclaw/handler.js ~/.openclaw/hooks/ask-to-remember/

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The hook manifest explicitly describes bootstrap prompt injection rather than the user-facing skill behavior, which indicates the skill modifies agent behavior at initialization in a way that is not transparently aligned with its stated purpose. Prompt injection at bootstrap is security-relevant because it can alter global agent decision-making, broaden when the skill triggers, or introduce hidden instruction precedence that is enforced only by prompt text rather than code-level controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The injected bootstrap content instructs the agent to read and write workspace files such as atr-state.json, MEMORY.md, and atr-log.jsonl automatically, including doing so 'before doing anything else', without any explicit user-facing notice or consent mechanism in this hook. In a memory-capture skill, silent persistence and logging of user-derived preferences increases privacy and integrity risk because the behavior is introduced at bootstrap and may execute outside the user's awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown scenario repeatedly frames the ideal behavior as writing an English email by default, including examples such as '帮我写一封英文邮件' and expected outputs entirely in English. Because the file does not indicate user language choice beyond these fixed examples, it encodes a language-specific behavior that could violate locale or language-choice policy if treated as normative skill guidance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The natural-language guidance includes Chinese-only example topic labels and refusal/vagueness phrases, which can steer the skill toward a specific language/locale without any user opt-in or documented locale scope. Because the file does not indicate that the skill is intentionally region-specific or multilingual, this may violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.