T01 · Skill Instruction Hijacking
- Location
migrate.py:303- Finding
Untrusted migration files can overwrite persistent Agent instructions and memory
- Content
View full analysis
Vulnerability Details
File Location:
migrate.py:303-316
Vulnerability Type: Persistent instruction and memory poisoning
Risk Level: CriticalVulnerable Code
python copied = 0 for fname in ["SOUL.md", "MEMORY.md", "TOOLS.md", "AGENTS.md", "IDENTITY.md", "USER.md"]: src = identity_dir / fname if src.exists(): shutil.copy2(src, ws_path / fname) copied += 1 memory_src = identity_dir / "memory" if memory_src.exists(): memory_dst = ws_path / "memory" memory_dst.mkdir(parents=True, exist_ok=True) for f in memory_src.glob("*.md"): shutil.copy2(f, memory_dst / f.name) copied += 1Technical Analysis
The migration package controls the contents of
SOUL.md,AGENTS.md,TOOLS.md,MEMORY.md,IDENTITY.md,USER.md, and historical memory files. These files are copied directly over files in the live main Agent workspace.The review process only lists the filenames at
migrate.py:721-738; it does not display their contents or a complete diff. A malicious package can therefore contain persistent behavioral instructions while presenting ordinary, expected filenames to the user.Because these files define Agent identity, operating instructions, tool guidance, user context, and persistent memory, this is more security-sensitive than an ordinary file overwrite.
Attack Path
- An attacker creates or modifies a migration package.
- The attacker places malicious instructions in
SOUL.md,AGENTS.md, orTOOLS.md. - The attacker places persistent false rules or state in
MEMORY.mdormemory/*.md. - The victim runs
migrate.pyand sees only the expected filenames during review. - The victim confirms the migration.
- The files overwrite the active Agent workspace.
- Future Agent sessions load and follow the attacker-controlled instructions or poisoned memory.
Impact Assessment
Successful exploitation can alter current and future Agent behavior, replace safety or operat ...[truncated 212 chars]
- Remediation
View remediation
Remediation Suggestions
- Restore identity and memory files into a quarantined workspace rather than the active workspace.
- Display complete unified diffs for every instruction-bearing or memory-bearing file.
- Require separate approval for
SOUL.md,AGENTS.md,TOOLS.md,MEMORY.md, and thememory/directory. - Do not overwrite existing files by default. Use versioned copies and an explicit promotion step.
- Reject unexpected file types, symbolic links, and files outside a strict allowlist.
- Support package signing and verify the package against a trusted public key before restoration.
- Record cryptographic hashes of reviewed files and verify that the same bytes are copied after approval.
