T02 · Agent Memory Poisoning
- Location
scripts/record_error.py:42- Finding
Persistent Agent Memory Poisoning Through Unsanitized Error Records
- Content
View full analysis
详细错误日志,按时间倒序记录。 --- {header}{record} """ log_file.write_text(content) ``` `SKILL.md:124-131`: ```markdown 在以下场景自动检索错误日志: | 场景 | 检查内容 | |------|----------| | 发布内容前 | 检查 #文件校验 #发布前检查 | | 网络请求前 | 检查 #网络超时 #降级方案 | | 浏览器操作前 | 检查 #浏览器不可用 | | 复杂任务前 | 检查相似任务的错误历史 | ``` ### Technical Analysis The `task`, `error`, `cause`, `fix`, and `tags` command-line values are interpolated directly into a persistent Markdown document. The implementation does not escape Markdown structure, identify the values as untrusted data, validate instruction-like content, or otherwise separate stored facts from executable Agent guidance. The Skill subsequently instructs the Agent to retrieve these records automatically before multiple classes of future tasks. Consequently, text supplied while recording an error can cross a session boundary and later be inserted into an Agent's working context. A malicious value could include additional Markdown sections or ...[truncated 1847 chars]- Remediation
View remediation
