Back to plugin

Security audit

Memory Hindsight

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this plugin suspicious because a scanner found that oversized responses from a configured Hindsight backend could exhaust gateway resources.

Review the finding before installing, especially if the configured Hindsight backend is not under your control. The reported risk could affect the gateway and other plugin operations; the scan did not establish arbitrary code execution, credential disclosure, or privilege escalation.

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 (1)

CWE-400

Warning
Location
plugin/dist/client.js:282
Finding

Unbounded Hindsight Write Responses Can Exhaust Gateway Memory ## Remediation Suggestions 1. **Enforce a bounded default centrally.** Make `request()` apply a response-size limit even when a caller does not specify one. Use `readBoundedText()` for every successful response instead of falling back to unrestricted `response.text()`. 2. **Use small limits for write acknowledgements.** Assign explicit, appropriately small response limits to `retain()` and `applyBankDefaults()`. Preserve larger limits only for operations that legitimately return memory content. 3. **Enforce limits while streaming.** Count bytes actually received and cancel the response body immediately when the limit is exceeded. Treat `Content-Length` as an optional early-rejection mechanism, not the sole enforcement control. Checking size after `response.text()` does not prevent excessive allocation. 4. **Retain timeouts as a separate control.** Keep request deadlines and host cancellation signals, but do not treat them as substitutes for byte limits. Limit response size before invoking `JSON.parse()`. 5. **Add regression tests.** Cover oversized retain and bank-setup responses with and without `Content-Length`, chunked responses, incorrect length declarations, and oversized valid JSON. Verify that reading stops at the limit, the body is cancelled, and errors do not include sensitive response content.

Content
View full analysis

Vulnerability Details

File Location: plugin/dist/client.js:282–306 and plugin/dist/client.js:607–616
Vulnerability Type: CWE-400 — Uncontrolled Resource Consumption
Risk Level: Medium

Vulnerable Code

The request handler buffers successful responses without a size limit when the caller omits maxBodyBytes:

js
let text;
if (init.maxBodyBytes === undefined) {
    text = await response.text();
}
else {
    try {
        text = await readBoundedText(response, init.maxBodyBytes);
    }
    catch (error) {
        if (error instanceof BodyTooLargeError) {
            throw new Error(`Hindsight ${operation} failed: response larger than ${init.maxBodyBytes} bytes`, { cause: error });
        }
        throw error;
    }
}
// SAFETY: T only names optional fields; every caller type-checks each field before use.
return (text ? JSON.parse(text) : {});

The retain operation does not supply a response-size limit:

js
async retain(bankId, item, options = {}) {
    await this.request("retain", this.bankUrl(bankId, "/memories"), {
        method: "POST",
        body: { items: [item], async: options.async ?? true },
        signal: options.signal,
    });
}

Bank setup also omits the limit:

js
async applyBankDefaults(bankId, defaults, signal) {
    const body = {};
    if (defaults.retainMission) {
        body.retain_mission = defaults.retainMission;
    }
    if (Object.keys(body).length === 0) {
        return;
    }
    await this.request("bank setup", this.bankUrl(bankId), { method: "PUT", body, signal });
}

Technical Analysis

request() applies streaming response limits only when its caller supplies maxBodyBytes. Both retain() and applyBankDefaults() omit this option, causing successful response bodies to be buffered completely through response.text() and subsequently passed to JSON.parse().

A malicious or compromised configured Hindsight backend can therefore return an oversized successful response. Buffer ...[truncated 1989 chars]

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

Endor dependency reachability

Checked Nov 20, 2026 · 5:58 PM UTC

No reachable vulnerabilities reported

Endor dependency scan completed.