MCP01
- Location
plugin/dist/index.js:2655- Finding
Scope-Based Forgetting Can Leave Retrievable Graph Copies While Reporting Successful Cleanup ## Remediation Suggestions 1. Have the authoritative scope-deletion operation return all deleted episode IDs, or maintain a durable mapping between memory records and their graph copies. Do not use limited semantic recall as the deletion inventory. 2. Coordinate memory and graph deletion transactionally where supported. Otherwise, enqueue durable, idempotent cleanup jobs with retries and reconciliation. 3. Return an incomplete or unknown cleanup status when inventory collection fails. Never infer complete cleanup solely from the absence of recorded removal failures. 4. Ensure recalled fact IDs are not incorrectly substituted for the episode IDs used as graph-node keys. 5. Test deletion involving more than 25 records, inventory failures, differing fact and episode IDs, and graph-service outages. Verify that forgotten text cannot subsequently be retrieved from graph copies.
- Content
View full analysis
Vulnerability Details
File Location:
plugin/dist/index.js:2655–2678
Vulnerability Type: Incomplete deletion of sensitive data
Risk Level: MediumVulnerable Code
js let candidateIds = []; try { const pre = await router.recallForPrompt(query, identity, 25); candidateIds = pre.results.map((r) => r.entry.id).filter(Boolean); } catch { // best-effort: cleanup proceeds without pre-collected ids } let scoped; try { scoped = await router.forgetAbout(query, identity); } catch (err) { return asToolError(err); } if (scoped.supported) { // Explicitly remove the graph copies of the forgotten memories so // a scope-based forget leaves nothing recallable in the graph. let graphFailures = 0; for (const cid of candidateIds) { if (!(await removeGraphCopy(client, cid, api.logger))) graphFailures++; } const affected = (scoped.affected ?? {});The subsequent response construction reports:
js graphCleanup: graphFailures > 0 ? `failed:${graphFailures}` : "removed",Technical Analysis
When
autoLinkSimilaris enabled, the plugin creates separate graph nodes containing memory text and embeddings. The memory backend's scope-based deletion does not automatically remove these plugin-created copies.The handler attempts to inventory graph copies using semantic recall limited to 25 results, then performs a separate scope-based deletion. There is no guarantee that the recalled IDs exhaustively identify the records deleted by that operation. A scope deletion can therefore remove more records than the graph-cleanup loop processes.
The exception handler also silently discards failures during the inventory step. In that case,
candidateIdsremains empty, no graph cleanup is attempted, andgraphFailuresremains zero. The response can consequently report graph cleanup as"removed"without verifying that the graph contains no surviving copies.This is a confirmed implementation defec ...[truncated 1761 chars]
