MCP07
- Location
plugin/engine/tools/memory-tools.js:804- Finding
User-scoped memories can lose access restrictions during shared knowledge promotion ## Remediation Suggestions 1. **Enforce authorization before curation.** Apply the canonical memory ACL to every candidate before including its text in a model request. Reject candidates when a trustworthy requester identity is unavailable. 2. **Separate access from publication authority.** Permission to read a user-scoped memory must not automatically permit publishing it into shared knowledge. Require explicit owner authorization for scope expansion. 3. **Restrict shared promotion by default.** Promote only entries explicitly authorized for the destination workspace. Keep user-scoped content in a separately protected knowledge store, or exclude it from shared curation. 4. **Preserve audience metadata end to end.** If mixed-audience canonical knowledge is required, retain ownership metadata per entry and enforce it during retrieval, prompt assembly, model requests, and caching. Document-level provenance alone is insufficient. 5. **Review existing knowledge documents.** Identify previously promoted restricted entries and remove or relocate them. Rebuild affected derived indexes and caches after cleanup. 6. **Add cross-user regression tests.** Verify that User B cannot promote or retrieve User A's pending user-scoped memory, including content that does not match confidential-content patterns. Also test background curation and callers without authenticated user identities.
- Content
View full analysis
Vulnerability Details
File Location:
plugin/engine/tools/memory-tools.js:804–809, with publication at line955
Related Retrieval Location:plugin/lib/recall-pipeline.js:1355(searchCanonical)
Vulnerability Type: Improper authorization and cross-user information disclosure
Risk Level: MediumVulnerable Code
The promotion pipeline filters pending database rows by epistemic status and heuristic confidentiality classification, but does not enforce ownership or restrict promotion to workspace-visible memories. The following is the complete selection expression, with comments omitted:
javascript pendingTexts = rows .filter(r => normalizeEpistemicStatus(r.epistemicStatus) !== "invalidated") .filter(r => classifySensitivityByRules(r.text).sensitivity !== "confidential" && r.sensitivity !== "confidential") .map(r => ({ id: r.id, text: r.text, category: r.category || "fact", scope: r.scope || "agent-private", importance: r.importance ?? 0.5, pendingKey: keyById.get(r.id) }));The generated knowledge document is subsequently published at line
955:javascript writeFileAtomicSync(knowledgePath, finalContent);Canonical retrieval searches the resulting document without per-entry ownership checks:
javascript export async function searchCanonical( workspaceDir, queryVector, embeddings, minScore, topN, logger, embeddingContext, options = {}, ) { const chunks = await getKnowledgeChunks(workspaceDir, embeddings, logger, embeddingContext, options); if (chunks.length === 0) return []; const mtimeMs = knowledgeMtimeMs(workspaceDir); const scored = chunks.map(c => ({ heading: c.heading, text: c.text, score: cosineSimilarityVec(queryVector, c.vector), mtimeMs, })); scored.sort((a, b) => b.score - a.score); return scored.filter(s => s.score >= minScore).slice(0, topN); }Technical Analysis
Normal memory access distinguishes
agent-private,workspace, andusersc ...[truncated 3145 chars]
