MCP07
- Location
index.js:306- Finding
Shared-Agent Participants Can Poison Owner-Attributed Persistent Memory ## Remediation Suggestions 1. **Authorize memory contributors.** Require a host-authenticated principal to match an explicit owner or contributor allowlist before promoting messages into owner-associated memory. Default shared-channel capture to disabled or approval-required. 2. **Preserve individual provenance.** Retain authenticated sender, channel, conversation, and message identifiers throughout extraction, outbox storage, summarization, and rendering. Do not apply one event-level identity to messages from multiple speakers. 3. **Bind configured names to verified identities.** Apply an owner display name only after matching the authenticated sender to that owner. Agent-wide configuration alone must not establish authorship. 4. **Separate memory trust domains.** Namespace storage and retrieval by authorized principal and conversation scope. Keep shared-channel evidence separate from private owner preferences. 5. **Require approval for trust promotion.** Store other participants' assertions as explicitly untrusted conversation evidence, not approved owner preferences or decisions. 6. **Apply controls to every persistence path.** Enforce authorization and attribution checks before capture and across successful summaries, disabled summarization, malformed model output, and failure fallbacks. 7. **Add regression tests and cleanup procedures.** Test multi-sender attribution, unauthorized preference insertion, and cross-conversation retrieval. Review existing shared-agent records for misattribution and remove or reclassify affected records and their indexed representations.
- Content
View full analysis
Vulnerability Details
File Location:
index.js:306–345— conversation capture without sender authorization and assignment of one identity to the captured increment.lib/messages.js:137–145— extraction discards individual sender provenance.lib/identity.js:61–65— agent-wide configured name overrides the actual sender identity.lib/summary.js:229–269,284–301— fallback record creation and persistent-memory record rendering.
Vulnerability Type: Insufficient authorization and attribution isolation in persistent memory.
Risk Level: Medium.
Vulnerable Code
The capture handler checks the agent and automation source, but does not authorize the sender to establish owner-associated memory:
js api.on('agent_end', (event, ctx) => { try { if (!ctx || !cfg.agents.includes(ctx.agentId)) return; if (event?.success === false) return; if (AUTOMATION_TRIGGERS.has(ctx.trigger)) return; if (ctx.inputProvenance?.kind === 'internal_system') return;User-message extraction retains message content and a key, but no per-message authenticated sender identity:
js if (role === 'user') { if (!hasText(message)) continue; items.push({ role: 'user', text: messageText(message), key: message.idempotencyKey ?? null }); if (typeof message.idempotencyKey === 'string' && message.idempotencyKey) { newAnchorKey = message.idempotencyKey; newAnchorOffset = i; } }Identity resolution always prefers the agent-wide configured name:
js export function resolveUserName({ userNames, agentId, senderId } = {}) { const configured = sanitizeName(userNames?.[agentId]); if (configured) return configured; return hashSenderId(senderId); }The captured increment receives that single identity:
js appendOutboxEntry(workspaceDir, sessionKey, { runId: ctx.runId ?? `unknown-${Date.now()}`, at: Date.now(), heading: localTime(new Date()), agentId: ctx.agentId, sessionKey, userName: resolveName(ctx), items, ...[truncated 3072 chars]
