Back to plugin

Security audit

amem

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this plugin suspicious because its memory consolidation can overwrite notes without checking write permission, under certain tool and storage conditions.

Review the plugin’s tool access and ensure its dedicated storage collection is not reused across agents unless agent filtering is enforced. The reported weakness could let a user who can invoke consolidation persistently alter an eligible note they cannot normally write; the scan does not establish arbitrary file access, code execution, or a guaranteed exploit.

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)

MCP07

Warning
Location
plugin/dist/index.js:2625
Finding

Memory consolidation bypasses write authorization through an unrestricted storage upsert ## Remediation Suggestions 1. **Enforce authorization at the storage boundary.** Require a caller identity for ordinary `updateNote()` operations and verify `canWrite()` against the stored note before any upsert. Reserve a separate, explicit maintenance interface for trusted internal operations. 2. **Authorize both merge participants.** Exclude non-writable notes before candidate generation, and recheck both notes immediately before mutation. Abort the merge if either authorization check fails. 3. **Restrict interactive consolidation.** Permit namespace-wide consolidation only for authorized owners or administrators. If ordinary chat participants may consolidate, constrain the operation to their permitted subject scope and writable notes. 4. **Validate dedicated-collection isolation.** Detect unintended collection reuse across agents. Where reuse is intentional, retain agent and reader filtering rather than relying exclusively on physical collection isolation. 5. **Handle partial failures safely.** Preflight authorization before replacing either note. Record merge state so failures during replacement, retirement, or link updates can be recovered without leaving unauthorized or inconsistent changes. 6. **Add regression tests.** Verify that consolidation cannot modify or retire non-writable notes, including when two agents share a dedicated collection, the protected note is selected as the retained note, or retirement of the second note is denied.

Content
View full analysis

Vulnerability Details

File Location: plugin/dist/index.js:2625–2730 — consolidation processing and unauthorized write; plugin/dist/index.js:4183–4208 — model-accessible tool handler.
Vulnerability Type: Missing authorization for persistent memory modification (CWE-862).
Risk Level: Medium.

Technical Analysis

The memory_consolidate tool invokes consolidation using the current agent’s storage scope. Consolidation retrieves private notes without requiring that the caller can write them:

javascript
const rawNotes = await ctx.listNotes(agentId);
const allNotes = rawNotes.filter((n) => n.agent_id !== "shared");

After selecting a sufficiently similar pair and receiving an affirmative LLM merge decision, consolidation updates the retained note and calls the unrestricted storage method:

javascript
keepNote.content = mergeDecision.merged;
keepNote.tags = Array.from(/* @__PURE__ */ new Set([...keepNote.tags, ...dropNote.tags]));
keepNote.keywords = Array.from(/* @__PURE__ */ new Set([...keepNote.keywords, ...dropNote.keywords]));
keepNote.links = Array.from(/* @__PURE__ */ new Set([...keepNote.links, ...dropNote.links])).filter(
  (id) => id !== keepNote.id && id !== dropNote.id
);
keepNote.retrieval_count = (keepNote.retrieval_count || 0) + (dropNote.retrieval_count || 0);
const keepAccessTime = new Date(keepNote.last_accessed || keepNote.timestamp).getTime();
const dropAccessTime = new Date(dropNote.last_accessed || dropNote.timestamp).getTime();
keepNote.last_accessed = keepAccessTime >= dropAccessTime ? keepNote.last_accessed || keepNote.timestamp : dropNote.last_accessed || dropNote.timestamp;
const embedText = buildEmbedText(keepNote);
keepNote.embedding = await encode(embedText);
keepNote.hash = (0, import_crypto.createHash)("md5").update(keepNote.content).digest("hex");
keepNote.evolution_history = keepNote.evolution_history || [];
keepNote.evolution_history.push({
  triggeredBy: dropNote.id,
  triggeredAt: (/* @__PURE__ */ 
...[truncated 3881 chars]

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

Endor dependency reachability

Checked Nov 10, 2026 · 5:38 PM UTC

No reachable vulnerabilities reported

Endor dependency scan completed.