Back to skill

Security audit

Openclaw Context Optimizer

Security checks for vulnerabilities and agentic risk

Overview

The skill does provide context compression, but it also includes under-controlled autonomous payments, unauthenticated dashboard APIs, and automatic context modification/storage that users should review carefully.

Review this skill before installing. Use it only if you are comfortable with automatic prompt/context compression and local retention of usage, pattern, wallet, and payment metadata. Do not give an agent unrestricted access to a funded wallet for this skill; require manual confirmation for every payment, keep the dashboard bound to localhost behind authentication, and avoid using it for sensitive conversations unless compression and learning behavior are explicitly scoped.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
README.md:52
Finding

Agent-facing instructions encourage autonomous irreversible payments without human approval

Content
View full analysis
0.5 USDT/month in reduced tokens, it pays for itself. No human approval needed. ``` `AGENT-PAYMENTS.md:142-200`: ```javascript // Agent evaluates if Pro features are worth the cost async function evaluateOptimizerUpgrade() { // Check current license const license = await fetch(`http://localhost:9092/api/x402/license/${myWallet}`); const licenseData = await license.json(); if (licenseData.valid) { console.log('Already have Pro license'); return; } // Evaluate value: calculate potential savings const stats = await fetch(`http://localhost:9092/api/stats?agent_wallet=${myWallet}`); const statsData = await stats.json(); // Calculate ROI const roi = await fetch(`http://localhost:9092/api/roi?agent_wallet=${myWallet}`); const roiData = await roi.json(); // If monthly savings exceed Pro cost (0.5 USDT), upgrade is profitable if (roiData.monthly_savings > 0.5) { console.log(`ROI positive: Save $${roiData.monthly_savings}/month, Pro costs $0.50`); await subscribeToPro(); } else if (licenseData.quota.used_today >= 95) { console.log('Approaching daily limit, consider upgrade'); await subscribeToPro(); } } async function subscribeToPro() { // Step 1: Create payment request const response = await fetch('http://localhost:9092/api/x402/subscribe', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ agent_wallet: myWallet }) }); const { payment_request } = await response.json(); // Step 2: Send payment via x402 const txHash = await myWallet.sendPayment({ recipient: payment_request.recipient, amo ...[truncated 3333 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/x402.js:174
Finding

Fabricated transaction hashes are accepted as valid payments

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
src/x402.js:65
Finding

Payment requests are not bound to the wallet receiving the license

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
src/dashboard.js:365
Finding

Unauthenticated dashboard APIs listen on all network interfaces

Content
View full analysis
{ try { const { agent_wallet, text, strategy } = req.body; if (!agent_wallet) { return res.status(400).json({ error: 'agent_wallet is required' }); } if (!text || typeof text !== 'string') { return res.status(400).json({ error: 'text is required and must be a string' }); } const optimizer = getContextOptimizer(); const result = await optimizer.compress(text, agent_wallet, strategy || 'hybrid'); ``` ```javascript app.get('/api/stats', async (req, res) => { try { const { agent_wallet } = req.query; if (!agent_wallet) { return res.status(400).json({ error: 'agent_wallet is required' }); } const optimizer = getContextOptimizer(); const stats = await optimizer.getStats(agent_wallet); ``` ```javascript app.get('/api/patterns', async (req, res) => { try { const { agent_wallet, type, limit } = req.query; if (!agent_wallet) { return res.status(400).json({ error: 'agent_wallet is required' }); } const optimizer = getContextOptimizer(); let patterns = await optimizer.getPatterns(agent_wallet, type || null); ``` ```javascript app.post('/api/feedback', async (req, res) => { try { const { agent_wallet, session_id, feedback_type, score, notes } = req.body; if (!agent_wallet || !session_id) { return ...[truncated 4156 chars]
Remediation
View remediation
{ // Server started. }); ``` 2. Require an explicit secure configuration option before permitting non-loopback binding. 3. Add authentication to every non-health endpoint using a high-entropy local API token or a properly designed authenticated session. 4. Require cryptographic proof of wallet ownership before allowing access to wallet-associated data or quota. 5. Enforce object-level authorization so an authenticated principal can access only its own records. 6. Apply rate limits globally and stricter per-wallet and per-IP limits to compression and payment endpoints. 7. Reduce the 10 MB JSON limit to the smallest operationally necessary size and enforce explicit text-length and complexity limits. 8. Add request timeouts and concurrency controls around compression operations. 9. Protect browser-accessible state-changing routes against CSRF and restrict allowed origins. 10. Do not expose detailed pattern text unless it is necessary; consider redaction, encryption at rest, and retention limits. 11. Reject malformed port values and use secure deployment documentation that accurately states the actual bind address. 12. Add integration tests confirming that unauthenticated requests are rejected and that the default listener is unreachable from non-loopback interfaces. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (55)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README explicitly states that agents can autonomously pay for Pro and that 'No human approval needed,' but does not provide a clear, prominent warning about real financial charges, consent, spend limits, or authorization boundaries. Because this skill is designed to hook automatically into agent workflows, normalizing autonomous payments without strong safeguards materially increases the risk of unauthorized or unintended spending.

Content

No source excerpt is available for this finding.

Context Leakage

High
Category
Data Exfiltration
Confidence
75% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · hooks/request-before.js (reported line 21)May include surrounding context.

js
const optimizer = getContextOptimizer();

    // Extract context to compress
    const contextToCompress = requestData.context || requestData.prompt || requestData.query || '';

    if (!contextToCompress || typeof contextToCompress !== 'string') {

Memory Manipulation

High
Category
Memory Poisoning
Confidence
94% confidence
Finding

The hook silently rewrites the request context with a lossy compressed summary before downstream processing. This can alter or omit security-relevant instructions, constraints, or user intent, enabling prompt/policy weakening, incorrect actions, or bypass of safeguards that depended on exact original context.

Content

Scanner excerpt · hooks/request-before.js (reported line 36)May include surrounding context.

js
preserve_quality: true
    });

    // Replace context with compressed version
    if (compressionResult && compressionResult.compressed) {
      // Update the request data with compressed context
      if (typeof requestData.context === 'string') {

Context Leakage

High
Category
Data Exfiltration
Confidence
91% confidence
Finding

The hook logs session metadata and usage statistics tied to a specific agent wallet, including a wallet-derived identifier prefix, license state, quota usage, and learned pattern summaries. In many agent platforms, console output is collected centrally or exposed to operators, making this a real information disclosure issue because it reveals user/account-linked operational data that may be unnecessary for routine logging.

Content

Scanner excerpt · hooks/session-end.js (reported line 27)May include surrounding context.

js
// Check license status
    const license = optimizer.x402.hasValidLicense(agentWallet);

    // Log session summary
    console.log(`\n========================================`);
    console.log(`[Context Optimizer] Session ${sessionId} ended`);
    console.log(`========================================`);

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This file implements payment processing and license management despite the skill being presented as a context optimizer, which creates a strong scope mismatch and expands the trust boundary in a security-sensitive way. The code can generate payment requests, collect wallet identifiers, verify transactions, and grant paid entitlements, so a user or integrator expecting text-compression functionality may unknowingly enable financial logic with meaningful business and security consequences.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document explicitly encourages autonomous agents to upgrade by sending irreversible on-chain payments without requiring any human approval, spending policy, or operator confirmation. In the context of an agent skill, this is dangerous because it can directly induce an agent with wallet access to spend funds based on marketing claims and local API responses, creating real financial loss risk.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

This code sends the agent wallet identifier to a local service and initiates a subscription/payment workflow based on the returned payment_request. In isolation the network call is normal, but in this skill context it is part of a mechanism to trigger autonomous financial transactions and trust unverified local responses, which increases the chance of unauthorized spending or data leakage to a local malicious service.

Content

Scanner excerpt · AGENT-PAYMENTS.md (reported line 173)May include surrounding context.

md
async function subscribeToPro() {
  // Step 1: Create payment request
  const response = await fetch('http://localhost:9092/api/x402/subscribe', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ agent_wallet: myWallet })

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · AGENT-PAYMENTS.md (reported line 173)May include surrounding context.

md
async function subscribeToPro() {
  // Step 1: Create payment request
  const response = await fetch('http://localhost:9092/api/x402/subscribe', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ agent_wallet: myWallet })

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · AGENT-PAYMENTS.md (reported line 190)May include surrounding context.

md
async function subscribeToPro() {
  // Step 1: Create payment request
  const response = await fetch('http://localhost:9092/api/x402/subscribe', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ agent_wallet: myWallet })

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

This request submits request_id, tx_hash, and agent_wallet to the verification endpoint and the document elsewhere admits the MVP trusts reported transaction hashes rather than verifying on-chain. That combination can let a local or compromised service falsely confirm payments, grant entitlements improperly, or trick agents into believing funds were handled correctly, while also disclosing transaction metadata.

Content

Scanner excerpt · AGENT-PAYMENTS.md (reported line 190)May include surrounding context.

md
});

  // Step 3: Verify payment
  const verifyResponse = await fetch('http://localhost:9092/api/x402/verify', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented hook behavior shows request context is automatically compressed before API calls, but the summary does not warn users that their prompts or operational context may be altered in-flight. This can create integrity and safety risks because users may rely on exact prompt contents for compliance, auditing, or model behavior, and silent modification can cause unexpected outputs or loss of critical instructions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The summary describes persistent storage of compression sessions, feedback, quotas, payment requests, and payment transactions in SQLite, but omits a privacy warning about collecting and retaining potentially sensitive operational and financial metadata. In an agent context, stored context fragments, usage analytics, and wallet/payment linkage can expose confidential data or create compliance issues if users are unaware of retention and storage 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 interception and compression of request context but does not prominently warn that pruning/summarization can drop critical details before model calls. In a context-handling skill, silent information loss can cause unsafe downstream behavior, incorrect decisions, or omission of safety-relevant instructions, making this more dangerous than a generic documentation gap.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README makes an absolute privacy claim that 'nothing [is] sent to external servers' and 'no tracking or telemetry,' but elsewhere documents external interactions such as x402 subscription/verification endpoints and a public GitHub issue tracker. Even if compression happens locally, overstating privacy/network behavior can mislead users into enabling a skill under false assumptions about data egress and payment-related communications.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises capabilities consistent with shell, network, and environment access, but the manifest does not declare any tool scope or permissions boundaries. That creates an authorization ambiguity where users and hosting platforms cannot clearly evaluate or constrain what the skill may do, increasing the risk of unexpected command execution, network access, or secret exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill states that it automatically intercepts request context, learns from it, and stores patterns over time, but it does not present a prominent warning or consent flow for modification and retention of conversation data. This is dangerous because sensitive prompts, credentials, proprietary information, or personal data could be transformed and persisted without the user's informed approval, potentially affecting confidentiality and response integrity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill promotes agent-driven ROI evaluation, wallet-linked API endpoints, and subscription flows, yet it does not clearly warn that an agent could initiate payment-related or wallet-associated actions. This is dangerous because autonomous subscription or verification behavior could trigger financial transactions, link identities via wallet addresses, or expose users to unauthorized purchases without meaningful confirmation.

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 · STORAGE_IMPLEMENTATION.md (reported line 45)May include surrounding context.

md
- `checkQuotaAvailable(agentWallet)` - Check if compressions available today
- `updateQuota(agentWallet, updates)` - Update quota settings
- `incrementCompressionCount(agentWallet)` - Track daily usage
- `initializeQuota(agentWallet)` - Create default free tier quota
- `resetDailyQuotaIfNeeded(quota)` - Automatic daily reset

#### Agent Tier Management

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The hook persists request/response-derived telemetry for 'learning' and pattern analysis, including agent identifiers, context lengths, success status, and potentially the original and compressed context contents. In a context-optimizer skill, this creates a real privacy and data-governance risk because prompts and responses may contain secrets, proprietary data, or personal information, and the code shows no consent, minimization, redaction, retention control, or disclosure boundary before sending that data into learner storage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This hook passes contextToCompress, derived from requestData.context, prompt, or query, into optimizer.compressor.compress(...) along with request metadata. Although the file comments mention compression, there is no confirmation prompt or explicit user-facing disclosure that potentially sensitive request content will be processed by a compressor component before the request proceeds.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest context names the skill "context-optimizer," and the surrounding schema mostly supports compression analytics and feedback. However, this table introduces subscription-tier, daily limits, and paid entitlement tracking, which is a separate licensing/billing control surface rather than an obvious implementation detail of optimizing context.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% 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 · src/COMPRESSOR_API.md (reported line 146)May include surrounding context.

md
**Use Case:** Remove conversational fluff and low-value phrases

**Automatically Removes:**
- Greetings: "Hello", "Hi", "Bye"
- Acknowledgments: "Thanks", "Okay", "Sure"
- Common questions: "Can you help me?", "How are you?"

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% 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 · src/COMPRESSOR_API.md (reported line 204)May include surrounding context.

md
**Use Case:** Remove conversational fluff and low-value phrases

**Automatically Removes:**
- Greetings: "Hello", "Hi", "Bye"
- Acknowledgments: "Thanks", "Okay", "Sure"
- Common questions: "Can you help me?", "How are you?"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file includes an example that posts result.compressed as context in a network request. Because compressed context may still contain user conversation history or other sensitive content, the documentation should explicitly warn that compression does not remove privacy risk before transmitting data externally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The guide explicitly recommends sending compressed conversation context to an API, but it does not warn that compression can omit qualifiers, safety constraints, or user intent. In a context-optimization skill, this is more dangerous because users are likely to apply it directly to prompts and chat history, where semantic loss can cause incorrect or unsafe model behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.