T02 · Agent Memory Poisoning
- Location
SKILL.md:10- Finding
Unsanitized ArXiv Content Is Persisted in Long-Term Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 10 and 17–25
Vulnerability Type: Persistent memory poisoning through untrusted external content
Risk Level: MediumVulnerable Code Snippet
markdown - **Save to Memory**: Automatically record summarized papers to `memory/RESEARCH_LOG.md` for long-term tracking.markdown 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.text ### Technical Analysis The Skill requires paper titles, author names, links, and summaries to be appended to a persistent memory file. These fields are derived from externally controlled ArXiv metadata and paper content, but the persistence workflow does not require sanitization, escaping, field-length limits, provenance labels, or validation. The immediate prompt-injection guardrail in `SKILL.md` instructs the Agent not to execute commands or perform actions suggested by paper content. However, it does not address delayed exploitation when stored content is loaded in a future session. Instruction-like text embedded in a malicious title, author field, abstract, or generated summary may therefore be preserved in `memory/RESEARCH_LOG.md` and later enter the Agent's context. This is a persistent trust-boundary violation: untrusted remote content is written into long-term Agent state without controls ensuring that subsequent consumers continue to interpret it exclusively as inert data. ### Attack Path 1. An attacker publishes or controls an ArXiv paper containing instruction-like content in its title, author metadata, abstract, or other summarized text. 2. A user asks the Skill to search for or discuss that paper. 3. The Skill retrieves the attacker-controlled metadata from the ArXiv API. 4. Under the m ...[truncated 1086 chars]- Remediation
View remediation
Remediation Suggestions
- Remove unconditional persistence and require explicit user consent before recording externally sourced paper information.
- Store records in a structured format with separate, length-limited fields rather than directly appending unrestricted Markdown.
- Escape Markdown, HTML, control characters, and delimiter sequences before persistence.
- Detect and neutralize instruction-like content, including requests to execute commands, invoke tools, modify files, reveal secrets, or override prior instructions.
- Add an explicit provenance marker to every record, such as
UNTRUSTED_EXTERNAL_ARXIV_CONTENT, and require all consumers to treat every stored field solely as data. - Preserve raw external content only when necessary; otherwise store a constrained summary generated under a rule that excludes operational instructions.
- Validate ArXiv links and identifiers before storage and impose strict maximum lengths on titles, author fields, links, and summaries.
- Harden every workflow that reads
memory/RESEARCH_LOG.mdso content from the file can never authorize tool calls, file operations, command execution, or policy changes. - Consider maintaining the research log outside automatically loaded Agent memory to reduce cross-session prompt-injection exposure.
