T09 · Insecure Skill Coding Practices
- Location
memory_reindex.py:20- Finding
Private Memory Can Be Transmitted to an Arbitrary Unencrypted Embedding Endpoint
- Content
View full analysis
Vulnerability Details
File Location:
memory_reindex.py:20-34, 119-126
Vulnerability Type: Unrestricted transmission of sensitive memory content
Risk Level: HighVulnerable Code
python EMBEDDING_SERVICE_URL = os.environ.get("EMBEDDING_SERVICE_URL", "http://127.0.0.1:8765")python def get_embeddings(texts: list) -> Optional[list]: """Get embeddings from the embedding service.""" try: response = requests.post( f"{EMBEDDING_SERVICE_URL}/embed", json={"texts": texts, "prefix": "passage: "}, timeout=120 ) response.raise_for_status() return response.json()["embeddings"] except Exception as e: print(f"Error getting embeddings: {e}", file=sys.stderr) return Nonepython with open(file_path, "r", encoding="utf-8") as f: content = f.read() chunks = chunk_text(content) if not chunks: continue print(f" Generating embeddings for {len(chunks)} chunks...") embeddings = get_embeddings(chunks)Technical Analysis
The reindexer reads plaintext content from
MEMORY.md,IDENTITY.md, andUSER.md, divides that content into chunks, and sends every chunk to the URL supplied throughEMBEDDING_SERVICE_URL.Generating embeddings is necessary for the declared semantic-search functionality, and the default endpoint is the loopback address
http://127.0.0.1:8765. However, the code does not enforce loopback operation, validate the destination host, require TLS for remote destinations, authenticate the embedding server, or ask for explicit consent before transmitting memory content remotely.Consequently, anyone who can modify the process environment or the sourced configuration file can redirect all indexed memory to an arbitrary server. If a non-loopback HTTP endpoint is selected, the data is also exposed to network interception and modification.
This exceeds the minimum privileges required for the documented local e ...[truncated 1419 chars]
- Remediation
View remediation
Remediation Suggestions
- Enforce loopback-only embedding endpoints by default. Resolve the configured hostname and reject destinations that do not map exclusively to
127.0.0.0/8or::1. - Prefer a Unix-domain socket for communication with the local embedding service.
- If remote embedding is intentionally supported, require a separate explicit opt-in setting such as
ALLOW_REMOTE_EMBEDDING=true. - Require HTTPS for every non-loopback endpoint and enable normal certificate verification.
- Authenticate requests using a narrowly scoped token or mutual TLS.
- Display a clear warning identifying the destination before private memory is transmitted remotely.
- Add optional secret scanning and redaction before embedding content.
- Limit memory-file access to explicitly approved, resolved paths and reject symbolic links where appropriate.
- Document that remote embedding transmits plaintext source material, not merely derived vectors.
- Enforce loopback-only embedding endpoints by default. Resolve the configured hostname and reject destinations that do not map exclusively to
