T02 · Agent Memory Poisoning
- Location
SKILL.md:93- Finding
Untrusted External Content Can Poison Persistent Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:93-110,SKILL.md:223,SKILL.md:231-235, andSKILL.md:253-265
Vulnerability Type: Persistent memory poisoning through untrusted external content
Risk Level: MediumVulnerable Documentation Excerpts
The following English rendering preserves the meaning of the relevant source instructions:
markdown ### Query workflow 1. Read DEEP-MEMORY.md (index table) 2. Extract keywords from user input 3. Traverse the index table and match the Keywords column 4. On match, read the corresponding deep-memory file 5. No match → Internet search ### Addition workflow 1. Determine the topic and keywords 2. Write the complete content to deep-memory/YYYY-MM-DD HH_MM_SS.md 3. Extract keywords and update the DEEP-MEMORY.md index table 4. Optional: synchronously update memory/YYYY-MM-DD.md to record the operationmarkdown Do not delete old files; only append or correct them to preserve historical versions.markdown Q: What should happen if deep-memory has no matching result? → First try an Internet search. After finding an answer, store it in deep-memory according to the addition workflow so it can be found next time.markdown Trigger conditions include: - The user sends an npm library, GitHub repository, or tool link and asks for it to be stored in memory. - After reading documentation or a blog, proactively extract its key content and store it in deep-memory.Technical Analysis
The Skill establishes an automated information flow from untrusted sources—including Internet search results, documentation, blogs, npm pages, and GitHub repositories—into persistent workspace files. It does not require source validation, prompt-injection screening, instruction removal, trust labeling, or user confirmation before persistence.
External documents can contain text crafted to look like operational instruction ...[truncated 2356 chars]
- Remediation
View remediation
Remediation Suggestions
- Treat all Internet, repository, package-registry, and user-linked content as untrusted data rather than agent instructions.
- Add a mandatory sanitization stage before persistence:
- Remove directives addressed to the agent.
- Reject requests to override higher-priority instructions.
- Remove requests for tool execution, credential access, memory modification, or policy changes.
- Preserve code and quotations inside clearly delimited data blocks.
- Require explicit user confirmation before creating or updating any persistent memory entry derived from an external source.
- Store provenance metadata with every entry, including the source URL, retrieval time, author when available, and a trust classification.
- Keep externally derived knowledge in a dedicated untrusted-reference namespace rather than writing it to general Agent memory.
- Prohibit automatic propagation of external content into
MEMORY.mdormemory/. - On retrieval, wrap memory content as quoted reference material and explicitly state that it cannot override system, developer, or current user instructions.
- Add validation for index paths and ensure retrieved paths remain inside the intended
deep-memory/directory. - Provide a deletion and quarantine process for suspicious entries instead of requiring indefinite historical retention.
- Audit the referenced
setup.mjs,query.mjs, andadd.mjsscripts before distributing or executing them; those files were not included in the reviewed project.
