T02 · Agent Memory Poisoning
- Location
index.js:28- Finding
Persistent Agent Memory Poisoning Through Untrusted Lesson Content
- Content
View full analysis
50 ? '...' : ''); const type = "Lesson"; ``` ```js const detailEntry = `\n### ${id} | ${category} | ${summary}\n**Date:** ${new Date().toISOString().split('T')[0]}\n${text}\n`; content += detailEntry; fs.writeFileSync(MEMORY_FILE, content); console.log(`Successfully internalized ${id} to MEMORY.md (Index + Detail)`); ``` ### Technical Analysis The `internalize` command treats the caller-controlled `text`, `category`, and `id` arguments as trusted memory content and stores them in `MEMORY.md`. The implementation does not distinguish factual lesson data from executable natural-language instructions. Only pipe characters in the first-line summary are replaced. The complete `text` value is appended without sanitization, and `category` and `id` are interpolated into Markdown headings and table content ...[truncated 1906 chars]- Remediation
View remediation
