T02 · Agent Memory Poisoning
- Location
scripts/learning-loop.js:220- Finding
Untrusted Session Content Can Poison Persistent Agent Skills
- Content
View full analysis
`tool-${i}`), steps: [ { title: 'Step 1', command: 'command1' }, { title: 'Step 2', command: 'command2' } ], summary: 'Simulated complex task', errorRecovery: true, errorType: 'TestError', complexity: 8 } } } ``` Attacker-controlled fields are copied into a persistent skill object: ```js async function extractWorkflowSkill(task) { // Extract reusable workflow from task const skill = { name: generateSkillName(task), description: task.summary || 'Automated workflow', version: '1.0.0', platforms: ['linux', 'macos'], steps: task.steps || [], toolCalls: task.toolCalls || [], metadata: { tags: extractTags(task), category: detectCategory(task), createdFrom: task.id } } return { skill } } ``` Those fields are interpolated into YAML and Markdown without safe serialization or instruction filtering: ```js async function createSkill(skill) { const skillDir = join(SKILLS_DIR, skill.metadata.category || 'misc', skill.name) await mkdir(skillDir, { recursive: true }) const skillContent = generateSkillMarkdown(skill) await writeFile(join(skillDir, 'SKILL.md'), skillContent) console.log(`\n📄 Created: ${join(skillDir, 'SKIL ...[truncated 3723 chars]- Remediation
View remediation
