T02 · Agent Memory Poisoning
- Location
SKILL.md:80- Finding
Untrusted User Content Can Poison Persistent Agent Memory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This memory skill broadly matches its purpose, but it stores and reuses sensitive personal context and can index account-wide session history without enough scoping or user control.
Install only if you are comfortable with an agent maintaining durable local memory. Do not store secrets, medication details, or other sensitive personal data in these memory files, avoid enabling the cron job until review/approval controls exist, and do not run session-sync.py unless you intend to index all sessions visible to that account.
SKILL.md:80Untrusted User Content Can Poison Persistent Agent Memory
scripts/session-sync.py:22Account-Wide Session Transcripts Are Indexed Without User or Channel Isolation
SKILL.md:37Documentation Recommends Plaintext Workspace Storage for Credentials
The declared description presents a broad persistent memory system for AI agents that supports remembering and recalling information across sessions using a three-layer architecture. The supplied code chunk does something much narrower: it is an offline maintenance/consolidation utility that reads recent daily markdown notes and writes categorized archival entries. While this loosely relates to the 'archival' aspect of memory maintenance, it does not implement the stated overall system behavior, such as core memory, recall memory, session continuity, user preference retrieval, or interaction-triggered persistence. The primary purpose is therefore materially narrower and different from the declared description.
The declared description is about agent memory persistence across sessions, including remembering user preferences and maintaining layered memory stores. The supplied code does none of that. Instead, it runs a GitHub CLI command against a specific repository and prints repo statistics such as stars, forks, issues, and PRs. This is a materially different primary purpose and involves external resource access to GitHub that is not implied by the description. Therefore, the description does not accurately represent the code chunk.
The declared description promises a broad persistent memory system for agents, including layered memory storage, cross-session recall of user preferences/context, explicit remembering behavior, and maintenance workflows. The supplied code instead implements a specific utility script that indexes session transcripts by extracting regex-matched topics and writing a summary JSON file. While this loosely relates to 'archival' or cross-session context, it is only a narrow session-topic indexing tool, not a full persistent memory system with core/archival/recall layers or explicit memory persistence and retrieval capabilities. Therefore the description materially overstates and misrepresents what this code chunk actually does.
The instruction 'if core says "Renate takes Desvenlafaxina", never ask about medications' normalizes retaining and reusing medication information, which is sensitive health data, without opt-in or necessity controls. Health information carries elevated privacy risk, and storing it in persistent agent memory can expose users to profiling, accidental disclosure, or misuse across sessions.
The skill instructs use of file reads, file writes, shell commands, and environment-dependent behavior, but it declares no explicit tool scope or permissions boundaries. That mismatch increases the chance an agent can invoke broader capabilities than reviewers or operators expect, which is dangerous in a persistence-oriented skill that routinely touches local state.
The skill is explicitly designed to persist user preferences, context, decisions, and other potentially sensitive information across sessions, yet it provides no clear warning about retention, privacy, or how long data is stored. In a memory skill, this context makes the issue more dangerous because persistence is the core function, so silent data accumulation is likely and foreseeable.
The core-memory template encourages storing personal facts, medication information, schedules, and credential references for repeated reuse across sessions, but lacks clear minimization, consent, or sensitivity boundaries. Because this skill's purpose is long-term memory, the surrounding context amplifies the danger: it creates a durable repository of sensitive user data that may be over-collected and broadly exposed to future agent runs.
The automatic behavior to 'update core immediately' when the user shares new personal information and to remember anything the user marks as memorable creates broad, default-on persistence. This is risky because users may disclose personal data conversationally without understanding it will be stored long-term and reused later.
The consolidation workflow instructs the agent to mine session notes for decisions, lessons, and new information, then promote them into long-term archival memory. This increases risk of secondary collection: information originally shared for a transient interaction may be transformed into durable records without the user's awareness or consent.
The integration guide instructs the agent to use and modify files under a workspace memory directory, including persistent notes and archival content, without warning that these operations can alter user data and persist across sessions. In a memory skill, silent file mutation is security-relevant because an agent may over-collect, overwrite, or retain sensitive information in ways the user does not expect.
The cron example sets up unattended auto-consolidation that periodically triggers an agent turn to review notes, extract items, and trim core memory, but it does not warn that this will run automatically and modify persistent files on a schedule. Unattended background execution increases the chance of unintended data retention, corruption, or processing of sensitive content without active user awareness.
The extraction logic matches primarily Spanish words such as "decisión", "aprendí", and several person/project names, which implicitly biases the skill toward a specific language and locale. Because the file does not offer user opt-in or clearly justify the language restriction, this is a natural-language policy concern under the language/locale rule.
Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.
results.append(f"Core memory: {word_count} words (limit: {max_words})")
if word_count <= max_words:
results.append("Within limit. No trimming needed.")
return results
sections = parse_sections(content)
This code rewrites memory/core.md after removing sections and moving their contents elsewhere, which is a potentially destructive file operation affecting user data. Although the script prints result messages after execution, there is no confirmation prompt or explicit warning in comments/docstrings near the write path that the original file will be modified and reduced.
This script performs external GitHub CLI and network activity that is unrelated to the stated purpose of the skill, which is persistent memory for agents. In agent ecosystems, extraneous network-capable scripts increase attack surface, create opportunities for telemetry or unauthorized outbound access, and may indicate bundled functionality that operators do not expect.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def check_stats():
import subprocess
result = subprocess.run(
["C:\\Program Files\\GitHub CLI\\gh.exe", "repo", "view", "renateparma/memoria-persistente-openclaw", "--json", "stargazerCount,forkCount,issues,pullRequests,description"],
capture_output=True, text=True, encoding="utf-8"
)
The docstring says the script checks "stars, forks, issues, downloads," but the gh repo view --json call requests stargazerCount,forkCount,issues,pullRequests,description and never retrieves or computes download counts. This is an active documentation-to-code mismatch about what the script measures.
No suspicious patterns detected.