Back to skill

Security audit

Memory ChromaDB

Security checks for vulnerabilities and agentic risk

Overview

This memory skill does what it says, but it automatically sends prompts to configurable services and injects stored memories into future turns, which creates privacy and prompt-injection risks users should review.

Install only if you trust the configured ChromaDB collection and embedding endpoint. Review whether autoRecall should be disabled, keep endpoints local unless you intentionally use remote services, and avoid indexing secrets, credentials, private transcripts, or untrusted documents without controls for review and deletion.

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)

T01 · Skill Instruction Hijacking

Error
Location
index.ts:400
Finding
Unsanitized ChromaDB Memories Can Cause Persistent Indirect Prompt Injection<![CDATA[ ## Vulnerability Details **File Location**: `index.ts:400-414` **Vulnerability Type**: Persistent indirect prompt injection through untrusted recalled memory **Risk Level**: High ### Vulnerable Code ```ts const memoryContext = relevant .map( (r) => `- [${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: `<chromadb-memories>\nRelevant context from long-term memory (ChromaDB):\n${memoryContext}\n</chromadb-memories>`, }; ``` ### 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 `<chromadb-memories>` 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
<![CDATA[ ## Remediation Suggestions 1. Treat every retrieved document and metadata field as untrusted data, regardless of collection ownership. 2. Disable automatic context injection by default and require explicit administrator opt-in. 3. Place recalled memories in a framework-supported untrusted-data channel rather than concatenating them into privileged context. 4. Add an explicit higher-priority instruction stating that recalled memories are reference material only and that instructions, tool requests, or policy claims contained within them must never be followed. 5. Validate record provenance and allow auto-recall only from trusted, authenticated ingestion sources. 6. Detect, quarantine, or require review for records containing instruction-like patterns, role markers, tool directives, or attempts to override previous instructions. 7. Escape or encode document text and metadata before embedding them in structured context. Do not rely solely on XML-like tags as a security boundary. 8. Require user confirmation before recalled content can cause tool execution, access sensitive information, or modify persistent state. 9. Preserve and display record identifiers and provenance so users can inspect which document influenced a response. 10. Add ingestion-time and retrieval-time security scanning, along with tests using poisoned documents that contain delimiter-breaking and instruction-override payloads. 11. Apply least privilege to the host agent so successful prompt injection cannot access unnecessary tools, credentials, files, or network services. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill explicitly states that auto-recall injects relevant stored memory before each turn, but the description does not clearly warn users that prior stored content may be surfaced into future prompts automatically. This creates a real privacy and prompt-scope risk because sensitive or untrusted remembered content can influence later model behavior without the user realizing it.

Intent-Code Divergence

Medium
Confidence
91% confidence
Finding
The header documentation states 'No cloud APIs,' which conveys a local/sandboxed intent, but the implementation uses fetch against configurable URLs for both Ollama and ChromaDB. Because those URLs are not restricted to localhost in code, the skill can send prompts and search queries to remote services, contradicting the documented behavior.

Ssd 3

Medium
Confidence
95% confidence
Finding
The plugin automatically retrieves semantically similar historical content and prepends it to every agent turn, which can leak prior user transcripts, secrets, or unrelated sensitive records into the current context. This is especially risky because retrieval is based on similarity rather than strict access controls or session boundaries, so data from one context may be exposed in another merely because it appears relevant.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The auto-recall hook sends every sufficiently long agent prompt to the embedding service and memory backend without any consent gate, visibility control, or destination validation. Because both endpoints are fully configurable, sensitive prompts may be transmitted to remote services or less-trusted local services, creating an unbounded privacy and data-handling risk.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The description states that relevant context is auto-injected before each turn, but it does not clearly warn users that previously stored memory may be surfaced into ongoing conversations automatically. This creates a meaningful privacy and prompt-scope risk because sensitive prior data can be reintroduced without an explicit per-turn user action or informed consent.

Static analysis

No suspicious patterns detected.