T02 · Agent Memory Poisoning
- Location
SKILL.md:7- Finding
Untrusted Context Is Persisted and Automatically Loaded into Future Agent Sessions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 7-10 and 19-23
Vulnerability Type: Persistent agent memory poisoning
Risk Level: HighVulnerable Code
bash # Save context fragment echo "$CONTENT" >> ~/.openclaw/context-cache/fragments.mdbash if [ -f ~/.openclaw/context-cache/fragments.md ]; then cat ~/.openclaw/context-cache/fragments.md fiTechnical Analysis
The skill permits arbitrary conversation content to be appended to a persistent cache without validation, provenance tracking, trust labeling, or separation between executable instructions and inert reference data. The integration then recommends loading that content during Agent session startup.
Because the restored text may be incorporated into the Agent's context, instruction-like content supplied by an attacker can persist across sessions and be interpreted as authoritative guidance. No review or confirmation step is required before the cached content is loaded.
Attack Path
- An attacker supplies text containing hostile instructions, such as directions to ignore later requests, disclose information, or invoke tools in an unsafe manner.
- The attacker or user invokes the skill using the memoization trigger.
- The hostile text is appended verbatim to
~/.openclaw/context-cache/fragments.md. - A future session executes the documented startup integration.
- The stored text is inserted into that session's context.
- If the Agent treats the restored text as instructions rather than untrusted data, the attacker can influence future Agent behavior.
Impact Assessment
Successful exploitation can contaminate future sessions for the same user account and manipulate the Agent's decisions, tool calls, or handling of later information. The vulnerability does not independently grant additional operating-system privileges; any resulting actions remain constrained by the tools and permissions already a ...[truncated 179 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not automatically merge cached content into system, developer, startup, or other trusted instruction contexts.
- Treat all restored fragments as untrusted quoted data and clearly delimit them from executable instructions.
- Require an explicit user review and confirmation before loading cached content into a new session.
- Reject or quarantine fragments containing instruction-like content, tool directives, role changes, or attempts to override higher-priority policies.
- Store structured records containing provenance, creation time, originating user, trust status, and a content hash.
- Allow users to inspect, approve, edit, and delete individual fragments instead of loading the entire cache.
- Apply expiration policies so unreviewed content cannot persist indefinitely.
