T09 · Insecure Skill Coding Practices
- Location
memory.js:223- Finding
Persistent memories are stored in plaintext without explicit access restrictions
- Content
View full analysis
5000) throw new Error('Content must be between 1 and 5000 characters'); const item = { id: randomUUID(), content: trimmed, timestamp: Date.now(), importance: importance ?? this.#config.defaultImportance, metadata, }; this.#memories.push(item); this.#dirty = true; this.#autoCleanup(); this.#save(); return item; } ``` ```javascript #save() { if (!this.#dirty) return; try { writeFileSync(this.#storePath, JSON.stringify(this.toJSON(), null, 2), 'utf-8'); this.#dirty = false; } catch (err) { console.error(`[memory] Error saving store: ${err.message}`); } } ``` ### Technical Analysis The engine accepts arbitrary memory content and metadata and serializes the complete store to a predictable plaintext JSON file. The write operation does not specify a restrictive file mode, does not encrypt sensitive values, and does not apply any secret-detection or data-classification controls. For a newly created file, Node.js uses the platform default creation mode subject to the process umask. Consequently, confidentiality depends on the runtime environment rather than an explicit security guarantee from the application. If the process has a permissive umask, the store may be readable by unintended local users. If the file already exists, writing it does not correct previously unsafe permissions. Because an AI memory store can contain user preferences, conversation-derived facts, internal ...[truncated 1223 chars]- Remediation
View remediation
