T02 · Agent Memory Poisoning
Warning
- Location
- SKILL.md:13
- Finding
- Untrusted ArXiv content is automatically persisted to long-term Agent memory<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 13-30 **Vulnerability Type**: Persistent storage of untrusted remote content **Risk Level**: Medium ### Vulnerable Code ```markdown - **Save to Memory**: Automatically record summarized papers to `memory/RESEARCH_LOG.md` for long-term tracking. - **Deep Dive**: Use `web_fetch` on the PDF link to extract more details if requested. ## Workflow 1. Use `scripts/search_arxiv.sh "<query>"` to get the XML results. 2. Parse the XML (look for `<entry>`, `<title>`, `<summary>`, and `<link title="pdf">`). 3. Present the findings to the user. 4. **MANDATORY**: Append the title, authors, date, and summary of any paper discussed to `memory/RESEARCH_LOG.md`. Use the format: ```markdown ### [YYYY-MM-DD] TITLE_OF_PAPER - **Authors**: Author List - **Link**: ArXiv Link - **Summary**: Brief summary of the paper and its relevance. ``` ``` ### Technical Analysis Paper titles, author fields, abstracts, and PDF contents are obtained from external sources and can contain attacker-controlled text. The workflow requires the Agent to process that content and persist a derived version of it in `memory/RESEARCH_LOG.md`, without requiring user approval or defining sanitization and trust-boundary controls. If persistent memory is subsequently loaded into an Agent context and treated as trusted instructions rather than inert research data, instruction-like material originating from a malicious paper could influence later sessions. Summarization may reduce this risk, but the Skill does not require the Agent to remove embedded directives or prevent them from being reproduced in the stored summary. ### Attack Path 1. An attacker publishes or controls an ArXiv submission containing instruction-like text in its title, abstract, author metadata, or PDF. 2. A user searches for a topic that causes the malicious submission to appear in the API results. 3. The Agent parses or fetches the attacker-controlle ...[truncated 727 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Treat all ArXiv API fields and PDF contents as untrusted data, never as Agent instructions. 2. Require explicit user confirmation before adding externally derived material to persistent memory. 3. Store research records in a structured data format with clearly delimited fields rather than mixing them with instruction-bearing context. 4. Sanitize or escape titles, authors, abstracts, and summaries before persistence, including instruction-like directives and markup capable of changing context interpretation. 5. Ensure that later memory-loading logic presents these records inside an explicitly untrusted data boundary. 6. Record source provenance and distinguish verbatim remote content from Agent-generated summaries. 7. Apply length limits to persisted fields and avoid storing unnecessary PDF text. ]]>
