T02 · Agent Memory Poisoning
- Location
SKILL.md:90- Finding
Persistent Agent Memory Poisoning Through Untrusted Extracted Content
- Content
View full analysis
<内容摘要> 来源: ``` 3. 如果现有 Skill 已包含相同内容(重复检测),跳过不重复添加 ``` ### Technical Analysis The workflow retrieves content from an arbitrary user-supplied webpage and appends the extracted material directly to a persistent `SKILL.md` file. A Skill file can be interpreted by an AI agent as instructions rather than passive data. The specification does not require sanitization, instruction detection, provenance labeling, trust validation, or isolation between executable instructions and externally sourced knowledge. An attacker can therefore place prompt-injection content in a webpage and submit that page for extraction. If the extraction preserves the malicious text, it becomes part of the generated Skill and is pushed to the configured GitHub repository. The attack persists beyond the original request and can affect future sessions whenever an agent loads the poisoned Skill. Duplicate detection does not mitigate this issue because it only prevents repeated insertion; it does not determine whether imported content is safe. ### Attack Path 1. An attacker publishes a webpage containing legitimate-looking material and embedded instructions directed at an AI agent. 2. The attacker sends a message such as `【python】https://attacker.example/article`. 3. The workflow retrieves the webpage through `extract_content_from_websites`. 4. The malicious instructions are included in the extracted text or generated summary. 5. The workflow appends that material to `skills/python/SKILL.md`. 6. The modified Skill is committed and pushed to the p ...[truncated 860 chars]- Remediation
View remediation
.md` or structured JSON, and clearly mark it as untrusted quoted material. 3. Add prompt-injection detection for instructions that attempt to change roles, override policies, invoke tools, access secrets, or direct future agents. 4. Strip hidden HTML, comments, metadata, scripts, encoded text, and instruction-like control content before storage. 5. Wrap imported text in an explicit data boundary and instruct consuming agents never to treat that section as commands. 6. Maintain source provenance, retrieval time, content hashes, and trust status for every imported document. 7. Require human review and approval before modifying or publishing any executable Skill file. 8. Apply repository protections, including pull-request review, signed commits where practical, and restricted write credentials. 9. Test generated Skills in an isolated environment before merging them into the main branch. ]]>
