Back to skill

Security audit

Context Compactor

Security checks for vulnerabilities and agentic risk

Overview

The plugin has a coherent context-compaction purpose, but it needs Review because it can automatically process prior conversation content through the active LLM despite local-only privacy claims and exposes an under-scoped transcript stats path.

Review this before installing in environments with sensitive chats or cloud model providers. Use an exact pinned package version, inspect the installed files, and configure or require a strict local-only summarization model if you rely on the privacy claim. Avoid enabling it for high-assurance workflows unless you are comfortable with lossy summaries influencing later agent context, and treat the gateway stats path issue as needing a fix before use in multi-user or remotely reachable gateways.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
index.ts:388
Finding

Gateway RPC Accepts an Unrestricted Transcript File Path

Content
View full analysis
{ try { const { sessionFile } = params; if (!sessionFile || !fs.existsSync(sessionFile)) { respond(true, { error: 'Session file not found', messages: 0, tokens: 0 }); return; } const entries = readTranscript(sessionFile); const messages = extractMessages(entries); const totalTokens = messages.reduce( (sum, m) => sum + estimateTokens(m.content, charsPerToken), 0 ); respond(true, { messages: messages.length, tokens: totalTokens, maxTokens, needsCompaction: totalTokens > maxTokens, cacheSize: summaryCache.size, }); ``` The invoked transcript reader performs a synchronous read of the supplied path: ```ts function readTranscript(sessionPath: string): SessionEntry[] { if (!fs.existsSync(sessionPath)) return []; const content = fs.readFileSync(sessionPath, 'utf8'); const lines = content.trim().split('\n').filter(Boolean); return lines.map(line => { try { return JSON.parse(line); } catch { return null; } }).filter(Boolean) as SessionEntry[]; } ``` ### Technical Analysis The gateway method takes `params.sessionFile` from its caller and passes it directly to `fs.existsSync` and `fs.readFileSync`. It does not resolve the path from a trusted session identifier, canonicalize it, restrict it to an approved transcript directory, reject symlinks, verify that it is a regular file, or limit its size. No authorization check for this gateway method is visible in the project. If an untrusted or insufficiently privileged client can invoke the method, it can cause the OpenClaw process to access any path readable with the process's filesystem privileges ...[truncated 1770 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
index.ts:223
Finding

Untrusted Conversation Content Can Become Privileged Compacted Context

Content
View full analysis
The following is a summary of earlier conversation that was compacted to fit context limits: ${summary} --- Recent conversation continues below: `, // Note: We can't actually replace messages in before_agent_start, // we can only prepend context. For full message replacement, // we'd need a different hook or session modification. }; ``` ### Technical Analysis Historical message content is untrusted because it can include attacker-controlled user messages, content copied from external sources, or previous model output. The plugin concatenates this content into a natural-language summarization prompt without robust instruction/data separation. An attacker can place directives in an older message telling the summarization model to ignore its task, preserve malicious instructions, misrepresent prior decisions, or produce text that directs the future agent to use tools. The result of that model call is trusted and prepended to the next agent invocation as compac ...[truncated 1973 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:39
Finding

Installation Instructions Execute an Unpinned Registry Package

Content
View full analysis
Remediation
View remediation

other

Warning
Location
README.md:47
Finding

Unconditional Local-Only Privacy Claim Conflicts with Cloud-Capable Summarization

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (11)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.md (reported line 121)May include surrounding context.

bash
# Remove plugin files
rm -rf ~/.openclaw/extensions/context-compactor

# Remove from config (edit openclaw.json and delete the context-compactor entry)
# Or restore from backup

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.md (reported line 121)May include surrounding context.

bash
# Remove plugin files
rm -rf ~/.openclaw/extensions/context-compactor

# Remove from config (edit openclaw.json and delete the context-compactor entry)
# Or restore from backup

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

The README instructs users to run npx jasper-context-compactor without pinning a specific version or integrity-checked source. That causes execution of whatever package version is current at install time, which creates a supply-chain risk if the package is updated maliciously, compromised, or republished with harmful code.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · README.md (reported line 27)May include surrounding context.

md
**The setup will:**

1. ✅ **Back up your config** — Saves `openclaw.json` to `~/.openclaw/backups/` with restore instructions
2. ✅ **Ask permission** — Won't read your config without consent
3. ✅ **Detect local models** — Automatically identifies Ollama, llama.cpp, MLX, LM Studio providers
4. ✅ **Suggest token limits** — Based on your model's contextWindow from config
5. ✅ **Let you customize** — Enter your own values if auto-detection doesn't match

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
84% confidence
Finding

The skill automatically summarizes and replaces older conversation content in-session, but insufficient warning about this behavior can cause users to rely on context that has been altered, omitted, or compressed. In security- or safety-sensitive workflows, lossy summarization can drop constraints, prior approvals, or sensitive details, leading to incorrect model behavior or accidental disclosure through malformed summaries.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The installation instruction uses npx jasper-context-compactor setup without a pinned version, so users will fetch and execute whatever package version is current at install time. That creates a supply-chain risk: if the package is compromised, typo-squatted, or updated maliciously, arbitrary code could run on the user's machine during setup.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The help text instructs users to run npx jasper-context-compactor without pinning a specific version. npx resolves the latest published package by default, so a compromised maintainer account, malicious new release, or package takeover could cause users to execute unexpected code at install/runtime. Because this file is a setup CLI that copies files and modifies config in the user's home directory, the trust boundary is important and dynamic package resolution increases supply-chain risk.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

This second unpinned npx jasper-context-compactor reference has the same supply-chain issue: it encourages execution of whatever version is current in the registry at the time of use. Even though it appears in help/usage text rather than executable logic, documentation-driven command execution is a common attack path because users often copy and paste these commands directly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

When compaction triggers, the plugin forwards older conversation content to an LLM for summarization without any consent flow, notice, or restriction on which model/provider receives that data. In this skill’s context, that can expose sensitive transcript material to a secondary model or remote backend unexpectedly, especially because the feature runs automatically in a pre-agent hook and may process the full prior conversation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The README states that charsPerToken value 4 "works for English," which bakes in a language-specific assumption without offering a user language choice or clearly documenting broader locale implications. This can create a policy concern because non-English users may receive degraded or misleading behavior based on an implicit English default.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.