T09 · Insecure Skill Coding Practices
- Location
src/embeddings.ts:94- Finding
Persistent memory content can be transmitted to an unrestricted or unencrypted embedding endpoint
- Content
View full analysis
{ const response = await fetch(`${config.ollamaUrl}/api/embeddings`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ model: config.ollamaModel, prompt: text }), }); if (!response.ok) { throw new Error(`Ollama error: ${response.status} ${response.statusText}`); } const data = await response.json() as { embedding: number[] }; return data.embedding; } ``` The transmitted text is assembled directly from persistent memory fields: ```ts // src/facts.ts:69-75 const text = input.key ? `${input.entity} ${input.key} ${input.value}` : `${input.entity} ${input.value}`; const entry: MemoryEntry = { id, entity: input.entity, ``` Embedding generation occurs automatically when vector search is enabled: ```ts // src/facts.ts:104-115 // Generate and store embedding if vector search is enabled if (config.vectorEnabled) { try { const embedding = await generateEmbedding(text, config); const serialized = serializeEmbedding(embedding); db.run( 'INSERT INTO fact_embeddings (fact_id, embedding, model) VALUES (?, ?, ?)', [id, serialized, config.ollamaModel] ); } catch (error) { ``` The CLI accepts an environment-controlled destination and enables transmission whenever that variable is present: ```ts // src/cli.ts:28-35 const DEFAULT_DB = `${process.env.HOME ?? '~'}/.zouroboros/memory.db`; const DEFAULT_CONFIG: MemoryConfig = { enabled: true, dbPath: process.env.ZO_MEMORY_DB ?? DEFAULT_DB, vectorEnabled: !!(proces ...[truncated 2770 chars]- Remediation
View remediation
