T02 · Agent Memory Poisoning
Error
- Location
- SKILL.md:55
- Finding
- Unvalidated External Feedback Can Influence Persistent Agent Memory and Workflows<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:55-59, 140-144` **Vulnerability Type**: Persistent memory poisoning through untrusted learning inputs **Risk Level**: High ### Vulnerable Code Snippet ```markdown ### MERGED State Handling When a PR is successfully MERGED: - **Remove from active tracking list** - **Add to merged records** for success tracking - **Celebrate the contribution!** - **Update skills and workflows** based on successful patterns ``` ```markdown ### Memory Tracking - Maintain PR tracking list in workspace memory - **Automatically clean up closed/rejected PRs** from tracking list - **Real-time synchronization** of tracking list file after any PR status change - Record resolution outcomes for learning - Update core memory with successful advocacy patterns ``` ### Technical Analysis The skill instructs the agent to derive behavioral patterns from pull-request activity and then update its skills, workflows, and core memory. Pull-request comments and outcomes are externally influenced inputs, but the instructions do not establish a trust boundary, sanitization process, approval requirement, or restriction on what may be persisted. Consequently, malicious or misleading review instructions could be treated as successful practices and stored in long-term state. Persisting such content allows its influence to survive the current skill execution and affect future sessions. The risk extends beyond maintaining factual PR status because the skill expressly permits modification of behavioral resources such as “skills,” “workflows,” and “core memory.” ### Attack Path 1. An attacker obtains the ability to submit review feedback on a monitored pull request, such as through a repository account, compromised reviewer account, or permissive contribution workflow. 2. The attacker embeds misleading operational rules or agent-directed instructions in review feedback. 3. The agent processes the feedback and implements the requested changes ...[truncated 815 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not automatically modify core memory, skill instructions, or reusable workflows based on pull-request content. - Store PR outcomes only as structured, skill-specific records rather than executable instructions or behavioral rules. - Treat review comments, issue text, commit messages, and PR descriptions as untrusted external data. - Remove or neutralize agent-directed instructions before processing external content. - Require explicit human approval before promoting any observation into long-term memory or reusable workflows. - Apply provenance metadata to stored records, including repository, PR, author, timestamp, and approval status. - Restrict persistent writes to a dedicated state directory with a documented schema and retention policy. - Provide a review and rollback mechanism for every persistent behavioral change. ]]>
