Back to skill

Security audit

Session Memory Structured

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but it automatically sends recent chat history to a configured model service and saves unreviewed model output into workspace memory.

Review this before installing. Use it only if you are comfortable with recent session content being sent to the model provider configured in your OpenClaw models.json, and review the generated memory files before letting future agents rely on them. For safer use, add explicit confirmation, redact sensitive content, constrain the provider, and validate or quarantine generated memory before it becomes trusted context.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Error
Location
handler.js:84
Finding

Untrusted Session Content Can Poison Persistent Agent Memory

Content
View full analysis
c.type === "text")?.text || ""; } else { text = obj.message.content || ""; } const cleanText = normalizeText(text); if (isUsefulText(cleanText)) { result.push({ role: obj.message.role, text: cleanText }); } } ``` ```js const historyText = messages.map((m) => `[${m.role.toUpperCase()}]: ${m.text}`).join("\n"); const providerConfig = await getProviderConfig(); if (!providerConfig || !providerConfig.apiKey || !providerConfig.baseUrl) { throw new Error("Local config lacks the specified provider or keys."); } const reqBody = { model: "ark-code-latest", messages: [ { role: "system", content: SYSTEM_PROMPT }, { role: "user", content: "以下是原始会话:\n\n" + historyText }, ], temperature: 0.3, }; const res = await fetch(`${providerConfig.baseUrl}/chat/completions`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${providerConfig.apiKey}`, }, body: JSON.stringify(reqBody), }); if (!res.ok) throw new Error(`API HTTP ${res.status}`); const json = await res.json(); const aiSummary = json.choices?.[0]?.message?.content; if (!aiSummary) throw new Error("Empty AI response"); const timeStr = `${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`; await fsPromises.mkdir(memoryDir, { recursive: true }); let block = ""; if (!existsSync(archiveFile)) { block += `# ${dateStr} 工作记忆\n\n`; } block += `---\n\n## 🧾 会话整理 - ${dateStr} ${timeStr}\n- Session ID: ${sessionId}\n\n${aiSummary}\n\n`; await fsPromises.appendFile(archiveFile, block, "utf8"); ``` ### Te ...[truncated 2613 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明的核心用途与主要触发条件基本一致:代码在 /new 或 /reset 时总结会话并写入 memory/YYYY-MM-DD.md。但声明遗漏了几项重要能力与资源访问。代码不仅本地归档,还会主动读取用户家目录中的 session 日志与模型配置文件,并将会话内容通过网络发送到外部聊天补全 API 来生成总结。这些属于实质性的未声明资源访问与外发能力,而声明中的 permissions 为空,无法准确反映实际行为。因此应判定为描述与行为不完全一致,存在明显 mismatch。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill description implies local archival only, but the implementation transmits the full recent session history to an external chat-completions endpoint. That creates a significant confidentiality risk because user prompts, assistant replies, and potentially sensitive workspace or metadata-derived content leave the local environment without an explicit disclosure or consent boundary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire skill description and usage guidance are written in Chinese, and there is no indication that the skill is intended only for a Chinese-speaking audience or that users may choose another language. This creates a natural-language locale constraint without opt-in, which matches the policy's language/locale violation criterion.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill reads provider configuration and API credentials from the agent's home-directory config even though its advertised function is just storing session summaries. Accessing broader agent configuration and secrets expands the trust boundary and enables unauthorized use of externally configured providers, increasing the blast radius if the skill is misused or modified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The SYSTEM_PROMPT instructs the model entirely in Chinese and specifies a fixed output format in Chinese, which effectively imposes a locale/language choice. The file does not offer a user opt-in, language selection, or a documented reason that this skill must be Chinese-only.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code sends conversation history to an external API endpoint using a bearer token without any visible user-facing warning or consent flow. In a session-memory skill, the context makes this more dangerous because users would reasonably expect local processing of past conversations, so silent exfiltration of chat content is a serious privacy and compliance issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill is documented only in Chinese, which can prevent non-Chinese-speaking users from understanding that it reads local OpenClaw session files and may send session content to an external model service. This creates an informed-consent and transparency risk: users may enable or trigger the skill without understanding its data access and exfiltration implications.

Content

No source excerpt is available for this finding.