T02 · Agent Memory Poisoning
- Location
skills/amazon-asin-dynamic-scoring/scripts/patch_scoring_to_agent.py:256- Finding
Persistent modification of Agent instruction files
- Content
View full analysis
[ ...]") print(" python3 patch_scoring_to_agent.py --all (auto-find all agents)") sys.exit(1) if sys.argv[1] == "--all": agents_dir = Path("/root/.linkfox/workspaces/agents") targets = sorted(agents_dir.glob("*/CLAUDE.md")) root_claude = Path("/root/.linkfox/workspaces/CLAUDE.md") if root_claude.exists(): targets.append(root_claude) else: targets = [Path(p) for p in sys.argv[1:]] ``` The content written by `patch_file()` adds new trigger phrases, Skill references, workflow steps, output requirements, and recommendations to the selected Agent instruction file. ### Technical Analysis The utility persistently rewrites `CLAUDE.md`, which is an Agent instruction and behavior configuration file. Its `--all` option enumerates every Agent configuration under `/root/.linkfox/workspaces/agents` and also targets the workspace-level configuration. This behavior is outside the minimum privileges needed to score ASIN data. The normal scoring operation only needs to read product data, calculate scores, and write result files. It does not need to modify the long-term instructions of the current Agent or unrelated Agents. Because the inserted instructions persist after the process ends, future sessions can continue to follow the injected rules. Although the bundled injected text is related to scoring, the mechanism itself is a persistent instruction-writing channel and could be altered or invoke ...[truncated 1178 chars]- Remediation
View remediation
