T01 · Skill Instruction Hijacking
- Location
index.ts:400- Finding
Unsanitized ChromaDB Memories Can Cause Persistent Indirect Prompt Injection
- Content
View full analysis
`- [${r.source}] ${r.text.slice(0, 300)}${r.text.length > 300 ? "..." : ""}`, ) .join("\n"); _consecutiveFailures = 0; // Reset on success api.logger.info( `chromadb-memory: auto-recall injecting ${relevant.length} memories (best: ${relevant[0].score.toFixed(3)} from ${relevant[0].source})`, ); return { prependContext: `\nRelevant context from long-term memory (ChromaDB):\n${memoryContext}\n`, }; ``` ### Technical Analysis The auto-recall handler retrieves document text from ChromaDB and inserts it directly into `prependContext` before an agent turn. The implementation performs only relevance filtering and length truncation. It does not validate document provenance, sanitize instruction-like content, escape structural delimiters, or establish an enforceable trust boundary between retrieved data and agent instructions. The `` wrapper is only textual markup and does not prevent the model from interpreting stored text as instructions. A malicious or compromised indexed document can therefore contain directives designed to override the user's intent, disregard safety constraints, disclose available context, or invoke tools. Because the content resides in long-term storage and auto-recall is enabled by default, malicious instructions can remain dormant until a semantically related user prompt retrieves them. This gives the injection persistent, cross-turn effects even though this plugin does not itself write the malicious record. ### Attack Path 1. An attacker gains the ability to influence content indexed into the configured ChromaDB collection, such as a session transcript, memory file, imported document, or compromised up ...[truncated 1521 chars]- Remediation
View remediation
