T02 · Agent Memory Poisoning
- Location
scripts/learner.py:5- Finding
Persistent Poisoning of Cross-Session Agent Memory Through Unrestricted Notes
- Content
View full analysis
1 else True rec = (sys.argv[2] if len(sys.argv) > 2 else "") print(json.dumps(record(ok, rec), ensure_ascii=False)) ``` The related Skill directives state, in English translation: ```text 2. Self-reflection loop: after execution, write to the self-reflection loop and accumulate failure patterns in the learner. 5. Continuous self-evolution: inject the learner into the meta-evolver sense/plan/record loop so that it improves across sessions. ``` ### Technical Analysis The command-line argument at `sys.argv[2]` is accepted as an unrestricted `note`. The `record()` function appends that value directly to the persistent `patterns` array in `scripts/learned_patterns.json`. There is no schema validation, maximum length, trust classification, content filtering, authorization check, or distinction between inert telemetry and instruction-like text. The Skill documentation additionally directs the agent to inject learner state into future reflection and evolution workflows. This creates a memory-poisoning channel: text controlled by a caller can survive the current invocation and later be ...[truncated 1478 chars]- Remediation
View remediation
