Back to plugin

Security audit

@nevermined-io/openclaw-plugin

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this plugin suspicious because it reports prompt injection risk, unrestricted requests that can expose payment tokens or reach internal services, and a paid endpoint that can consume excessive memory.

Consider the reported prompt injection, network and payment-token exposure, and memory exhaustion risks before installing. The scanner describes exploitable conditions that depend on configuration, access, and host protections; it does not report demonstrated successful exfiltration or code execution.

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
  • 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 (3)

MCP06

Error
Location
dist/index.js:63
Finding

Remote Plan Metadata Is Injected into Agent Prompt Context ## Remediation Suggestions 1. Use administrator-approved local display names in instruction-bearing prompt context instead of remote plan names. 2. Separate trusted payment instructions from externally sourced metadata. 3. Present remote metadata as explicitly untrusted structured data, with clear instructions not to interpret its contents as operational guidance. 4. Apply reasonable length limits and normalize control characters and line breaks. Treat these measures as defense in depth, not a complete prompt-injection defense. 5. Enforce purchase approval, destination authorization, and sensitive-tool permissions outside the model. 6. Add regression tests using plan names containing multiline instructions and forged payment guidance.

Content
View full analysis

Vulnerability Details

File Location: plugin/dist/index.js:63–78, 273–285
Vulnerability Type: Indirect prompt injection
Risk Level: High

Vulnerable Code

Remote plan metadata is retrieved and incorporated into the catalog:

javascript
const balances = await Promise.all(plans.map(async (plan) => {
    try {
        const b = await p.plans.getPlanBalance(plan.planId);
        return {
            ...plan,
            planName: b.planName ?? plan.name ?? plan.planId,
            balance: Number(b.balance),
            isSubscriber: b.isSubscriber,
        };
    }
    catch {
        return { ...plan, planName: plan.name ?? plan.planId, balance: 0, isSubscriber: false };
    }
}));
const text = formatPlanCatalog(balances, config.creditsPerMinute, config.creditsPerRequest);
catalogCache = { text, fetchedAt: now };
return { prependContext: text };

The catalog formatter directly interpolates the remote plan name:

javascript
for (const p of plans) {
    const method = p.paymentType === 'fiat' ? 'Credit Card' : 'Crypto (USDC)';
    const priceStr = p.price ? ` — ${p.price}` : '';
    const creditsStr = p.credits ? ` for ${p.credits} credits` : '';
    if (p.paymentType === 'crypto') {
        const balanceStr = p.isSubscriber ? ` [balance: ${p.balance} credits]` : ' [not subscribed]';
        lines.push(`  ${p.planName} (${method})${priceStr}${creditsStr}${balanceStr}`);
    }
    else {
        lines.push(`  ${p.planName} (${method})${priceStr}${creditsStr} [auto-charge]`);
    }
}

Technical Analysis

The before_prompt_build hook retrieves externally supplied plan names and places them directly into prepended model context. There is no length restriction, control-character handling, or explicit separation identifying these names as untrusted data.

The catalog also contains legitimate behavioral instructions about payments, purchases, and bookings. Consequently, malicious text embedded in a plan name appears alongside truste ...[truncated 1647 chars]

MCP01

Warning
Location
dist/tools.js:179
Finding

Unrestricted Agent URLs Allow SSRF and Insecure Payment-Token Delivery ## Remediation Suggestions 1. Bind agent destinations to administrator-approved seller origins associated with the selected plan and agent. 2. Require HTTPS, with a separate, explicitly enabled development option for local HTTP. 3. Reject loopback, private, link-local, and reserved addresses, including IPv6 forms and DNS-resolved destinations. 4. Enforce destination restrictions at connection time to address DNS rebinding. 5. Disable redirects or validate every redirect destination before forwarding payment credentials. 6. Restrict HTTP methods to those required by the integration. 7. Require the intended token version and reject backend downgrades where single-use or resource-binding guarantees are required. 8. Keep spending approval independent of model-generated parameters and apply network egress restrictions as defense in depth.

Content
View full analysis

Vulnerability Details

File Location: plugin/dist/tools.js:179–188, 213–227, 588–602
Vulnerability Type: Server-side request forgery and bearer-token exposure
Risk Level: Medium

Vulnerable Code

The destination and HTTP method are supplied through tool parameters:

javascript
const agentUrl = requireStr(params, 'agentUrl');
const prompt = requireStr(params, 'prompt');
const paymentType = str(params, 'paymentType') ?? config.paymentType ?? 'crypto';
const planId = str(params, 'planId') ?? resolveDefaultPlanId(config, paymentType);
if (!planId)
    throw new Error('planId is required — provide it as a parameter or in the plugin config');
const agentId = str(params, 'agentId') ?? config.agentId;
const method = str(params, 'method') ?? 'POST';
warnIfInsecureUrl(agentUrl);

The plugin mints a token and sends it to that destination:

javascript
const { accessToken, tokenVersion } = await getPayments().x402.getX402AccessToken(planId, agentId, tokenOptions);
// Asking for v3 and getting v2 means the token is reusable and bound to
// nothing. Nothing else on this path would say so: the ignored-binding
// warning covers explicit params only, and this tool passes derived
// ones.
if (num(params, 'tokenVersion') === 3 && tokenVersion !== 3) {
    console.warn(`[nevermined] tokenVersion 3 was requested but the backend minted v${tokenVersion}. ` +
        'The token is reusable and not bound to this endpoint.');
}
const response = await fetch(agentUrl, {
    method,
    headers: {
        'Content-Type': 'application/json',
        'payment-signature': accessToken,
    },
    body: method !== 'GET' ? JSON.stringify({ prompt }) : undefined,
});

The URL check does not block insecure destinations:

javascript
function warnIfInsecureUrl(url) {
    try {
        const parsed = new URL(url);
        if (parsed.protocol === 'https:')
            return;
        const host = parsed.hostname;
        if (host === 'localhost' || host === '127.0.0
...[truncated 2949 chars]

MCP05

Warning
Location
dist/paid-endpoint.js:136
Finding

Unbounded Paid-Endpoint Request Buffering Can Exhaust Gateway Memory ## Remediation Suggestions 1. Enforce a small maximum request-body size while reading the stream. 2. Count actual received bytes, including chunked requests, and stop reading immediately when the limit is exceeded. 3. Return `413 Payload Too Large` for oversized requests and release retained buffers. 4. Check `Content-Length` early, but do not rely on it as the only enforcement mechanism. 5. Apply upload deadlines, concurrent-request limits, and per-client rate limits. 6. Require a JSON object containing a string `prompt` with a bounded length. 7. Handle aborted streams and parser errors explicitly. 8. Configure matching reverse-proxy limits and test oversized, slow-streaming, aborted, and concurrent uploads.

Content
View full analysis

Vulnerability Details

File Location: plugin/dist/paid-endpoint.js:34–40, 66–70, 136–150
Vulnerability Type: Resource exhaustion / denial of service
Risk Level: Medium

Vulnerable Code

The endpoint verifies payment access before reading the request body:

javascript
const verification = await getPayments().facilitator.verifyPermissions({
    paymentRequired,
    x402AccessToken: accessToken,
    maxAmount,
});

After successful verification, it parses the body:

javascript
const body = await parseBody(req);
const prompt = typeof body === 'object' && body !== null && 'prompt' in body
    ? body.prompt
    : String(body);

The complete parser retains all received chunks without a size limit:

javascript
function parseBody(req) {
    return new Promise((resolve, reject) => {
        const chunks = [];
        req.on('data', (chunk) => chunks.push(Buffer.from(chunk)));
        req.on('end', () => {
            const raw = Buffer.concat(chunks).toString('utf-8');
            try {
                resolve(raw ? JSON.parse(raw) : {});
            }
            catch {
                resolve(raw);
            }
        });
        req.on('error', reject);
    });
}

Technical Analysis

The parser copies and retains every incoming chunk until the request ends. At completion, Buffer.concat, UTF-8 conversion, and JSON parsing can create additional large allocations.

The plugin supplies no body-size limit, upload deadline, or concurrency bound. Payment verification restricts who can reach the parser but does not limit how much data a verified caller can submit.

Credit settlement occurs only after request processing. It therefore cannot stop a verified upload from consuming excessive memory before processing or settlement begins.

Attack Path

Prerequisites: The operator enables the paid HTTP endpoint, configures its plan, and the attacker possesses a payment token that passes verification. Any additional gateway or ...[truncated 1194 chars]

SkillSpector was not run because this plugin release contains no bundled skills.

Endor dependency reachability

Checked Nov 11, 2026 · 2:36 PM UTC

No reachable vulnerabilities reported

Endor dependency scan completed.