T02 · Agent Memory Poisoning
- Location
scripts/learner.py:12- Finding
Unvalidated Attacker-Controlled Notes Persisted in Cross-Session Learning State
- 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 intended cross-session use is also documented in `SKILL.md:31-35`, including the requirement to inject results into the learner and continuously evolve behavior across sessions. ### Technical Analysis The `record()` function accepts an arbitrary `note` and appends it to `patterns` without schema validation, content filtering, size limits, provenance tracking, or separation between passive observations and executable instructions. The resulting value is persisted in `scripts/learned_patterns.json`. Because the skill explicitly advertises this file as part of a cross-session learning and evolution loop, attacker-controlled text can become durable state. If a downstream agent, prompt builder, or `meta-evolver` component later interprets stored patterns as behavioral guidance, malicious notes can influence future sessions. The present repository does not contain the downstream consumer that converts these records into agent instructions. Consequently, direct future instruction execution is conditional on the advertised external learning integration. The confirmed behavior within this package is persistent storage of arbitrary caller-supplied content. The storage ...[truncated 1629 chars]- Remediation
View remediation
