Back to skill

Security audit

Session Compact

Security checks for vulnerabilities and agentic risk

Overview

The plugin has a coherent session-compression purpose, but its implementation has high-impact safety issues around shell execution, config logging, session-file access, and automatic history rewriting.

Review before installing. The core idea is legitimate, but this version should not be used with sensitive conversations or credentials until shell invocation is replaced with non-shell argument execution, debug config logging is removed or redacted, session IDs are strictly validated, and users get clear control over automatic compaction and summary review.

Vulnerability Patterns
  • 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
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
src/compact/engine.ts:48
Finding

Conversation Content Enables Shell Command Injection During Compaction

Content
View full analysis
0 ? Array.from(toolNames).join(', ') : '无'} **文件引用**: ${fileCandidates.size > 0 ? Array.from(fileCandidates).slice(0, 8).join(', ') : '无'} ``` ### Technical Analysis `execSync()` receives a single command string and therefore executes it through a system shell. The implemented escaping only handles backslashes, double quotes, and line endings. It does not neutralize shell substitutions that remain active inside double-quoted arguments, including: - `$(command)` - Backtick command substitution - Other shell-specific expansions Conversation text is copied into `autoTimeline`, incorporated into the prompt, and then interpolated into the shell command. A short payload such as `$(id)` or `$(touch /tmp/marker)` can fit within the 60-characte ...[truncated 1297 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
src/compact/session-manager.ts:201
Finding

Attacker-Controlled Conversation Text Is Persisted as a System Instruction

Content
View full analysis
): string { const recentMessages = messages.slice(-10); const timeline = recentMessages .filter(m => { const text = 'blocks' in m ? extractMessageText(m as ConversationMessage) : (m as any).content || ''; return text.trim().length > 5; }) .map(m => { const text = 'blocks' in m ? extractMessageText(m as ConversationMessage) : (m as any).content || ''; const content = text.trim().substring(0, 60); const role = m.role; return ` - ${role}: ${content}${text.length > 60 ? '...' : ''}`; }); return timeline.join('\n'); } ``` The resulting summary is wrapped in behavioral instructions: ```typescript export function getContinuationPrompt(summary: string, preserveRecent: boolean): string { let prompt = 'This session is being continued from a previous conversation that ran out of context. The summary below covers the earlier portion.\n\n'; prompt += `Summary:\n${summary}\n\n`; if (preserveRecent) { prompt += 'Recent messages are preserved verbatim.\n\n'; } prompt += 'Continue the conversation from where it left off without asking further questions. Resume directly — do not acknowledge the summary, do not recap, and do not preface with continuation text.'; return prompt; } ``` The content is then promoted to a system-role message and persisted: ```typescript // Create continuation message const continuationMessage = createSystemMessage( getContinu ...[truncated 3233 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/compact/session-store.ts:33
Finding

Unvalidated Session IDs Permit Filesystem Path Traversal

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/index.ts:38
Finding

Plugin Logs Potentially Sensitive Host Configuration Without Redaction

Content
View full analysis
Remediation
View remediation
0 }); ``` 3. Do not log the actual model string if it can contain endpoint or tenant information. 4. Introduce a centralized redaction function for keys matching patterns such as `token`, `secret`, `password`, `authorization`, `credential`, and `apiKey`. 5. Keep debug logging disabled by default and document its data-handling implications. 6. Add tests confirming that representative secrets never appear in captured stdout or stderr during plugin registration. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
Findings (60)

Known Vulnerable Dependency: tar==6.2.1 — 12 advisory(ies): CVE-2026-59873 (node-tar: Decompression/parse DoS via unlimited input); CVE-2026-24842 (node-tar Vulnerable to Arbitrary File Creation/Overwrite via Hardlink Path Trave); CVE-2026-26960 (Arbitrary File Read/Write via Hardlink Target Escape Through Symlink Chain in no) +9 more

Critical
Category
Supply Chain
Confidence
97% confidence
Finding

tar==6.2.1 carries multiple serious archive handling issues including path traversal, arbitrary file overwrite, and DoS. In an agent/plugin ecosystem, archive extraction is especially dangerous because installation, updates, extension loading, or imported assets can make vulnerable tar handling reachable and enable filesystem compromise.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill documentation materially overstates implemented behavior, including automatic session management, persistence, and CLI functionality that static analysis indicates may not exist or may be only partially implemented. This is dangerous because operators may trust the plugin to manage history, persistence, or configuration safely when it does not, leading to silent failures, loss of context, or incorrect security assumptions about what data is stored and how it is handled.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The workflow says compaction happens automatically and without user awareness, while also allowing a model to generate summaries from conversation content. That creates a real privacy/data-handling issue because sensitive prompts, secrets, or personal data may be sent to a summarization model without clear user notice or consent.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: ws==8.19.0 — 2 advisory(ies): CVE-2026-45736 (ws: Uninitialized memory disclosure); CVE-2026-48779 (ws: Memory exhaustion DoS from tiny fragments and data chunks)

High
Category
Supply Chain
Confidence
92% confidence
Finding

ws==8.19.0 is a known vulnerable version with memory disclosure and DoS advisories, and WebSocket libraries are frequently reachable in agent ecosystems that support remote providers or integrations. Even though this session-compaction plugin does not justify WebSocket features itself, the oversized dependency surface makes the vulnerable package more concerning because a host environment may load or expose it indirectly.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: @hono/node-server==1.19.9 — 3 advisory(ies): CVE-2026-39406 (@hono/node-server: Middleware bypass via repeated slashes in serveStatic); GHSA-frvp-7c67-39w9 (Node.js Adapter for Hono: Path traversal in `serve-static` on Windows via encode); CVE-2026-29087 (@hono/node-server has authorization bypass for protected static paths via encode)

High
Category
Supply Chain
Confidence
80% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: undici==7.24.7 — 12 advisory(ies): CVE-2026-6733 (undici vulnerable to HTTP response queue poisoning via keep-alive socket reuse); CVE-2026-13697 (undici vulnerable to cross-user information disclosure and parse-time crash via ); CVE-2026-16728 (undici vulnerable to downstream response desynchronization via retry interceptor) +9 more

High
Category
Supply Chain
Confidence
89% confidence
Finding

undici==7.24.7 has multiple high-severity HTTP client advisories, including response desynchronization and information disclosure risks. In an AI-agent environment that routinely makes outbound provider requests, a vulnerable HTTP client increases risk even if the plugin’s advertised function is only session compression, because the dependency graph suggests unnecessary network-capable components are present.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: @mariozechner/pi-coding-agent==0.65.2 — 3 advisory(ies): CVE-2026-54326 (Pi Agent: Potential XSS in HTML session exports via Markdown URL sanitization by); CVE-2026-54328 (Pi Agent: Predictable temporary extension install paths allow local privilege es); CVE-2026-54327 (Pi Agent: Race condition in Pi auth.json writes could expose stored credentials)

High
Category
Supply Chain
Confidence
93% confidence
Finding

@mariozechner/pi-coding-agent==0.65.2 is unrelated to a session-compaction plugin yet brings in vulnerabilities affecting credential handling, temp paths, and exported content. The mismatch between declared purpose and inclusion of a coding-agent package materially increases concern because it expands the attack surface into sensitive local-file and auth workflows that a compaction plugin should not need.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: brace-expansion==5.0.5 — 4 advisory(ies): CVE-2026-13149 (brace-expansion: DoS via exponential-time expansion of consecutive non-expanding); CVE-2026-45149 (brace-expansion: Large numeric range defeats documented `max` DoS protection); CVE-2026-14257 (brace-expansion: DoS via unbounded expansion length causing an out-of-memory pro) +1 more

High
Category
Supply Chain
Confidence
80% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · src/compact/engine.ts (reported line 393)May include surrounding context.

ts
prompt += 'Recent messages are preserved verbatim.\n\n';
  }
  prompt += 'Continue the conversation from where it left off without asking further questions. Resume directly — do not acknowledge the summary, do not recap, and do not preface with continuation text.';
  return prompt;
}

/**

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The session ID is interpolated directly into a filesystem path via join(this.storageDir, ${sessionId}.json) without validation or canonical path enforcement. An attacker who can influence sessionId can use path traversal sequences such as '../' to read, overwrite, or delete files outside the intended session directory when save/load/delete operations are called.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
84% confidence
Finding

The documented purpose is to manage stored session data, and deleting old session files within the session directory would fit that purpose. But because session filenames are not constrained earlier, the cleanup and delete flows can operate on filesystem locations outside the declared session store boundary, expanding the capability from session maintenance to broader file deletion.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document explicitly instructs users to install the plugin with --dangerously-force-unsafe-install, which bypasses the platform's safety controls. Although it notes the plugin is 'blocked' and later mentions '需强制安装', it does not clearly warn users that this disables security protections or explain the risks, making unsafe installation more likely.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file title and all instructional content are written in Chinese, and there is no indication that users may choose another language or that the plugin is intentionally restricted to a Chinese-speaking audience. This creates a natural-language locale policy concern under the rule for language/locale constraints without user opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The checklist at L274 explicitly says real OpenClaw session storage integration is still pending, which means core behavior is not fully implemented. That directly conflicts with the status claims at L281-L284 that the project is a stable published version, creating an intent/documentation divergence about implementation maturity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation promotes automatic session compaction as seamless and beneficial, but it does not clearly warn users that older messages are replaced by a summary and may no longer remain fully visible or recoverable in-context. For a session-management skill, this omission can mislead users about data retention and context fidelity, increasing the risk of accidental loss of important details, weakened auditability, or unintended exposure through summaries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file states that the plugin automatically compresses historical messages and generates summaries, which implies processing potentially sensitive conversation content. Under the markdown criteria for missing warnings, the description should disclose that user conversation data may be sent to or processed by an LLM and may affect privacy or retained context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file explicitly notes that callLLM() invokes the OpenClaw CLI via execSync, which is a subprocess operation and may pass conversation content to another process. For markdown files, safety-relevant behaviors affecting privacy or system integrity should be disclosed to users, but no warning accompanies this behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README promotes automatic compression and replacement of earlier messages with summaries, but it does not prominently warn that summarization can omit, distort, or reinterpret prior context. In a conversation-management plugin, this can cause users or downstream agents to rely on altered history, leading to mistakes, lost instructions, or unsafe decisions if important details are dropped.

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.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Automatic conversation compression changes historical context and can discard or transform prior messages without clearly warning users about possible context loss, summary errors, or modification of the effective conversation record. In an assistant workflow, that can affect decision quality, omit safety-relevant instructions, or misrepresent prior user intent, especially when compression is automatic and seamless.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation promotes automatic session compaction but does not clearly warn users that prior conversation content will be rewritten into a summary and that fidelity may be reduced. In a session-management skill, silent rewriting of history can cause users to rely on incomplete or altered context, creating safety and privacy risks even if the feature is not maliciously intended.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · TROUBLESHOOTING.md (reported line 162)May include surrounding context.

Result: Skill now appears in openclaw skills list as ✓ ready.

Step 2: Create openclaw.plugin.json

json
{

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The document includes a destructive clawhub delete openclaw-session-compact --yes command with no warning, confirmation guidance, or explanation of consequences. Even in troubleshooting documentation, readers may copy-paste commands directly, which can cause unintended deletion of an existing published package/skill and potential loss of availability or publishing state.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest exposes multiple CLI triggers but does not declare any activation constraints, scoping rules, or guard conditions indicating when these commands should be available. In a plugin system, overly broad command activation can increase attack surface by making sensitive or state-changing functionality callable in unintended contexts, especially for a session-management plugin that can rewrite or compress conversation history.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest describes a local session compression plugin with CLI commands for compacting and inspecting sessions, but the resolved dependency graph includes a general AI abstraction layer pulling in OpenAI, Anthropic, Google GenAI, AWS Bedrock runtime, and proxy/network stacks. That behavior suggests the packaged skill may participate in external model access and broader agent operations, which is not reflected in the manifest's narrow description of session compaction.

Content

No source excerpt is available for this finding.