T02 · Agent Memory Poisoning
- Location
scripts/learner.py:5- Finding
Unsanitized Attacker-Controlled Data Persisted as 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)) ``` ### Technical Analysis The learner accepts its second command-line argument as an arbitrary note and appends it directly to the persistent `patterns` array. It applies no schema validation, provenance tracking, trust classification, content sanitization, length restriction, or entry-count limit. The Skill documentation describes this file as supporting cross-session learning and continuous evolution. If a subsequent reflection or meta-evolver component consumes these entries as behavioral guidance, an attacker can store instruction-like content that may influence future sessions. The implementation also fails to distinguish untrusted observations from trusted rules. The included project does not contain the downstream component that interprets these patterns. Therefore, direct instruction execution is not demonstrated within the audited package, but the persistent untrusted-data channel and its intended use as learning state are present. ### Attack Path 1. An attacker supplies crafted text through task content or another input that reaches the learner invocation. ...[truncated 1263 chars]- Remediation
View remediation
