Back to plugin

Security audit

Kimi Code Agent Harness

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this plugin suspicious because it found unexpected network access risks and a response-size weakness in its FetchURL feature.

Consider the gateway's network access and availability before installing. The scanner reports static findings, not a live exploit: internal data exposure and gateway disruption are possible, but neither a specific data theft nor a guaranteed crash was demonstrated. The verdict is suspicious, not malicious.

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

other

Error
Location
plugin/vendor/kimi-code-sdk.mjs:288346
Finding

FetchURL Allows Internal-Network Requests Despite Its Public-Only Guarantee ## Remediation Suggestions 1. **Enforce destination restrictions before connecting.** Parse and normalize each URL, reject prohibited literal addresses, resolve hostnames, and reject non-public IPv4 and IPv6 destinations, including loopback, private, link-local, multicast, unspecified, and IPv4-mapped equivalents. 2. **Prevent DNS rebinding.** Bind connection establishment to the validated address using an appropriate resolver or connection dispatcher while preserving correct HTTP host handling and TLS verification. 3. **Validate every redirect.** Apply identical destination restrictions to each hop and fail closed on prohibited destinations. Preserve the existing redirect-count limit. 4. **Remove silent trust-boundary changes.** Disable unrestricted local fallback from remote fetching, or require an explicit administrator-controlled policy with the same destination protections. 5. **Add gateway egress controls.** Block access to internal networks and metadata services at the network layer unless explicitly required. 6. **Clarify approval semantics.** Document that manual mode and `approvalPolicy: "deny"` do not disable default-approved tools. Provide an explicit host-network capability control. 7. **Add regression tests.** Cover direct internal addresses, public-to-private redirects, IPv6, encoded address forms, DNS rebinding, and remote-provider fallback. Correct the tool description until its public-only guarantee is enforced.

Content
View full analysis

Vulnerability Details

File Location: plugin/vendor/kimi-code-sdk.mjs, lines 288346–288405. Related tool execution: lines 277271–277325; provider selection: lines 288505–288538; native approval policy: lines 293650–293690 and 293890–293930.
Vulnerability Type: Server-Side Request Forgery (CWE-918)
Risk Level: High

Vulnerable Code

The complete request-and-redirect method validates each URL but does not restrict its network destination:

js
async requestWithRedirects(url2, signal) {
  let currentUrl = url2;
  let redirects = 0;
  for (; ; ) {
    validateFetchUrl(currentUrl);
    const response = await this.fetchImpl(currentUrl, {
      method: "GET",
      headers: { "User-Agent": this.userAgent },
      signal,
      redirect: "manual"
    });
    if (!REDIRECT_STATUSES.has(response.status)) return response;
    const location = response.headers.get("location");
    if (location === null) return response;
    await response.body?.cancel().catch(() => {
    });
    if (redirects >= MAX_REDIRECT_HOPS) throw new Error2(
      ErrorCodes$1.WEB_FETCH_FAILED,
      `Too many redirects while fetching "${url2}" (limit ${String(MAX_REDIRECT_HOPS)}).`,
      { details: {
        url: url2,
        limit: MAX_REDIRECT_HOPS
      } }
    );
    redirects += 1;
    currentUrl = new URL(location, currentUrl).toString();
  }
}

The complete destination validator only checks URL parsing and protocol:

js
function validateFetchUrl(url2) {
  let parsed2;
  try {
    parsed2 = new URL(url2);
  } catch {
    throw new Error2(
      ErrorCodes$1.WEB_INVALID_URL,
      `Invalid URL: "${url2}"`,
      { details: { url: url2 } }
    );
  }
  if (parsed2.protocol !== "http:" && parsed2.protocol !== "https:")
    throw new Error2(
      ErrorCodes$1.WEB_INVALID_URL,
      `Unsupported URL scheme "${parsed2.protocol}" \u2014 only http(s) allowed.`,
      { details: {
        url: url2,
        protocol: parsed2.protocol
      } }
    );
}

Technical

...[truncated 2984 chars]

MCP05

Warning
Location
plugin/vendor/kimi-code-sdk.mjs:288312
Finding

FetchURL Buffers Unbounded Response Bodies Before Enforcing Its Size Limit ## Remediation Suggestions 1. **Replace whole-body buffering with bounded streaming.** Read response chunks incrementally, maintain a cumulative byte count, and cancel the reader immediately when the configured maximum is exceeded. 2. **Enforce the limit before decoding and parsing.** Bound the bytes delivered by the response stream, including decompressed output, before constructing a complete string or HTML document. 3. **Treat headers as advisory.** Retain `Content-Length` only as an early-rejection optimization; enforce the same actual-byte limit when the header is absent or inaccurate. 4. **Bound time and concurrency.** Add response deadlines, idle-read timeouts, concurrent-fetch limits, and aggregate memory budgets. 5. **Clean up on failure.** Cancel the body and release reader resources on overflow, timeout, abort, and parsing errors. 6. **Add regression tests.** Cover chunked oversized responses, missing length headers, compressed responses that expand beyond the limit, stalled streams, and concurrent requests. Verify cancellation occurs close to the configured limit rather than after full consumption.

Content
View full analysis

Vulnerability Details

File Location: plugin/vendor/kimi-code-sdk.mjs, lines 288312–288345.
Vulnerability Type: Uncontrolled Resource Consumption (CWE-400)
Risk Level: Medium

Vulnerable Code

The complete response-reading method buffers the body before measuring its actual size:

js
async readResponse(response) {
  if (response.status >= 400) {
    await response.body?.cancel().catch(() => {
    });
    throw new HttpFetchError(
      response.status,
      `HTTP ${String(response.status)} ${response.statusText}`
    );
  }
  const contentLengthRaw = response.headers.get("content-length");
  if (contentLengthRaw !== null) {
    const cl = Number(contentLengthRaw);
    if (Number.isFinite(cl) && cl > this.maxBytes) {
      await response.body?.cancel().catch(() => {
      });
      throw new Error2(
        ErrorCodes$1.WEB_FETCH_FAILED,
        `Response body too large: ${String(cl)} bytes exceeds maxBytes (${String(this.maxBytes)}).`,
        { details: {
          bytes: cl,
          maxBytes: this.maxBytes
        } }
      );
    }
  }
  const body = await response.text();
  const actualBytes = Buffer.byteLength(body, "utf8");
  if (actualBytes > this.maxBytes) throw new Error2(
    ErrorCodes$1.WEB_FETCH_FAILED,
    `Response body too large: ${String(actualBytes)} bytes exceeds maxBytes (${String(this.maxBytes)}).`,
    { details: {
      bytes: actualBytes,
      maxBytes: this.maxBytes
    } }
  );
  const contentType = (
    response.headers.get("content-type") ?? ""
  ).toLowerCase();
  if (
    contentType.startsWith("text/plain") ||
    contentType.startsWith("text/markdown")
  ) return {
    content: body,
    kind: "passthrough"
  };
  return {
    content: this.extractMainContent(body),
    kind: "extracted"
  };
}

Technical Analysis

The local provider defaults to a maximum response size of 10 MiB. Its early rejection depends on the optional Content-Length header. When that header is absent, the code calls `resp ...[truncated 2042 chars]

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

Endor dependency reachability

Checked Nov 14, 2026 · 9:11 AM UTC

No reachable vulnerabilities reported

Endor dependency scan completed.