T02 · Agent Memory Poisoning
- Location
SKILL.md:95- Finding
Persistent Delayed Execution of Untrusted Task Instructions
- Content
View full analysis
This task is a temporary heartbeat and is automatically deleted after execution ## Task Info - **Created At:** {creation time} - **Execute At:** {execution time} - **Task ID:** {unique ID} - **Status:** pending ## Task Content {task content} ## Execution - [ ] Task executed - [ ] Result recorded - [ ] File deleted ``` The reference implementation interpolates task content directly into that persistent file: ```typescript async function createTempHeartbeat( executeAt: Date, content: string ): Promise { const taskId = `task_${Date.now()}_${Math.random().toString(36).substr(2, 6)}`; const filePath = `memory/temp-heartbeat-${Date.now()}.md`; const taskContent = `# Temp Heartbeat Task > ⚠️ This task is a temporary heartbeat and is automatically deleted after execution ## Task Info - **Created At:** ${new Date().toISOString()} - **Execute At:** ${executeAt.toISOString()} - **Task ID:** ${taskId} - **Status:** pending ## Task Content ${content} ## Execution - [ ] Task executed - [ ] Result recorded - [ ] File deleted `; await writeFile(filePath, taskContent); return { id: taskId, executeAt, content, filePath, status: 'pending', }; } ``` The periodic processing workflow later reads the stored file and passes its contents to an execution routine without showing any safety validation or authorization check: ```typescript async function checkAndExecuteTasks(): Promise { const tempHeartbeatFiles = await glob('memory/temp-heartbeat ...[truncated 3426 chars]- Remediation
View remediation
