Back to plugin

Security audit

Nexus Memory

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this plugin suspicious because its guardrail tool may expose private protection rules and may approve destructive actions when rule loading is incomplete.

Consider the reported privacy and guardrail reliability issues before installing. The scan reports real weaknesses, but does not establish malicious intent or show that the checked commands were executed; destructive impact depends on a separate execution step and other protections.

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)

MCP07

Warning
Location
plugin/tools/guardrail_check.ts:196
Finding

Guardrail Check Exposes Private Protection Rules to Public Sessions ## Remediation Suggestions 1. Resolve the caller’s effective access level using `toolCallAccessLevel(cfg.accessLevel, toolCallId)`. 2. Apply visibility restrictions before exposing any rule-derived text, paths, or identifiers. 3. Separate internal enforcement from disclosure. If enforcement must evaluate private rules, return a generic block response to unauthorized callers rather than the private matched-rule payload. 4. Apply equivalent authorization to override handling and any other interface that exposes rule metadata. 5. Add tests covering public, trusted, private, unbound, and expired-session calls. Include a root-targeting probe and verify that private rule information never reaches a lower-trust response.

Content
View full analysis

Vulnerability Details

File Location:

  • plugin/tools/guardrail_check.ts:167–185 — constructs results containing protected rule data.
  • plugin/tools/guardrail_check.ts:196–225 — loads rules without access-level restrictions.
  • plugin/tools/guardrail_check.ts:351–368 — executes without resolving the caller’s session authorization.

Vulnerability Type: Missing Authorization / Information Disclosure (CWE-862)
Risk Level: Medium
Confidence: High

Vulnerable Code

The rule query restricts category but not visibility:

ts
const points = await qdrantClient.scrollFiltered(
  { must: [{ key: "category", match: { value: "rule" } }] },
  200,
)

Matched results include private rule text, paths, and identifiers:

ts
function collectMatches(
  targets: string[],
  rules: ProtectionRule[],
  action: string,
): Array<Record<string, unknown>> {
  const matched: Array<Record<string, unknown>> = []
  for (const target of targets) {
    for (const rule of rules) {
      if (pathMatches(target, rule.path)) {
        matched.push({
          target,
          protected_path: rule.path,
          rule_text: rule.ruleText,
          source_memory_id: rule.sourceId,
          action,
        })
      }
    }
  }
  return matched
}

The tool handler ignores the tool-call identity and directly returns the evaluation:

ts
async execute(
  _toolCallId: string,
  params: { command: string; tool_name?: string; tool_input?: Record<string, unknown> },
) {
  const { command, tool_name: checkedToolName = "", tool_input: toolInput = {} } = params

  const result = await evaluateGuardrail(
    qdrantClient,
    cfg,
    checkedToolName,
    command,
    toolInput,
  )

  return { content: [{ type: "text" as const, text: JSON.stringify(result) }] }
},

Technical Analysis

Other memory tools resolve a session-bound access level before exposing stored memories. nexus_guardrail_check does not apply that authorization mechanism: _toolCallId is ig ...[truncated 2086 chars]

other

Warning
Location
plugin/lib/qdrant-client.ts:823
Finding

Incomplete Protection-Rule Loading Produces Fail-Open Guardrail Decisions ## Remediation Suggestions 1. Implement a strict rule-loading operation that propagates failures from every page, including failures after records have been collected. 2. Distinguish complete results from truncated results. If a page or resource limit is reached while a continuation offset remains, treat protection rules as unavailable and block the destructive assessment. 3. Keep best-effort pagination separate from security-sensitive reads; do not return the same success-shaped result for partial and complete rule sets. 4. Remove the rule-side length restriction. Use consistent extraction and normalization for both protected paths and command targets. 5. Resolve relative paths against a trusted working directory when supported; otherwise report an indeterminate result rather than `allow`. 6. Add regression tests for later-page failures, collections exceeding 1,000 rules, and protections for `/`, `~`, `.`, and `/a`. 7. Treat model-invoked guardrail advice as defense in depth. Enforce critical destructive-operation restrictions independently at the actual execution boundary.

Content
View full analysis

Vulnerability Details

File Location:

  • plugin/lib/qdrant-client.ts:823–897 — bounded pagination and partial-result recovery.
  • plugin/tools/guardrail_check.ts:196–230 — accepts the returned rule set and excludes short protected paths.
  • plugin/tools/guardrail_check.ts:310–333 — returns allow when no loaded rule matches.

Vulnerability Type: Fail-Open Safety Control / Incomplete Security Evaluation (CWE-636)
Risk Level: Medium
Confidence: High

Vulnerable Code

The pagination error handler returns partial data whenever an earlier page contained records:

ts
} catch (err) {
  // OCR-5 (security medium): a first-page failure re-throws — the outer
  // contract must let fail-closed consumers (guardrail_check) see the
  // outage instead of receiving [] ("no rules" → allow). Mid-walk
  // failures (points already collected) keep the partial-result return.
  if (collected.length === 0) {
    log.error(
      `scrollFiltered: first page failed for collection="${this.collection}" — no partial result, throwing (fail-closed)`,
      err,
    )
    throw err
  }
  log.error(
    `scrollFiltered: request failed for collection="${this.collection}" (returning ${collected.length} points collected so far)`,
    err,
  )
  return collected
}

The rule parser excludes valid short paths:

ts
for (const pattern of PATH_PATTERNS) {
  const globalPattern = new RegExp(pattern.source, pattern.flags)
  let match: RegExpExecArray | null
  while ((match = globalPattern.exec(text)) !== null) {
    const path = match[0].trim()
    if (path && path.length > 2) {
      const expanded = path.startsWith("~/") ? path.replace(/^~/, process.env.HOME || "~") : path
      rules.push({
        path: expanded,
        ruleText: text.slice(0, 200),
        sourceId: String(point.id),
      })
    }
  }
}

The evaluator interprets an empty loaded rule set as permission to proceed:

ts
if (rules.length === 0) {
  return { verdict: "allow", reason: `Destruc
...[truncated 2602 chars]

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

Endor dependency reachability

Checked Nov 14, 2026 · 8:49 AM UTC

No reachable vulnerabilities reported

Endor dependency scan completed.