T02 · Agent Memory Poisoning
- Location
scripts/cli-registry.py:440- Finding
Persistent Agent Memory Poisoning Through Untrusted CLI Help Output
- Content
View full analysis
80: return output ``` ```python result = { "binary": binary, "version": _fetch_version(binary), "help_raw": _clean_help_raw(text), "usage": _extract_usage(text), "summary": _extract_summary(text), "commands_text": _format_commands_text(parsed_subs), "options_text": _format_options_text(parsed_opts), "subcommands": {}, "global_options": [], } ``` ```python entry = { "name": name, "binary": binary, "description": description, "official_skill": official, "registered_at": datetime.now().isoformat(), "keywords": keywords, "auto_discovered": info, } REGISTRY_DIR.mkdir(parents=True, exist_ok=True) path = REGISTRY_DIR / "{}.json".format(name) path.write_text(json.dumps(entry, indent=2, ensure_ascii=False), encoding="utf-8") ``` The Skill explicitly instructs the Agent to trust this persisted content: ```markdown When the tool is NOT in the built-in knowledge base (no human-written description, no keywords), you MUST read its `help_raw` field — it's your only source of truth. ``` ### Technical Analysis The standard output and standard error of an arbitrary local execut ...[truncated 2162 chars]- Remediation
View remediation
