T01 · Skill Instruction Hijacking
- Location
references/memory-bridge.ts:20- Finding
Untrusted Cross-Platform Messages Are Promoted to System-Level Instructions
- Content
View full analysis
{ const parts: string[] = []; // Read MEMORY.md — curated long-term memories try { const mem = await fs.readFile(path.join(WORKSPACE, 'MEMORY.md'), 'utf8'); parts.push('## MEMORY.md\n' + mem); } catch {} // Read today's daily notes try { const today = new Date().toISOString().slice(0, 10); const daily = await fs.readFile(path.join(WORKSPACE, 'memory', `${today}.md`), 'utf8'); parts.push("## Today's Notes\n" + daily); } catch {} // Read yesterday's daily notes try { const d = new Date(); d.setDate(d.getDate() - 1); const yesterday = d.toISOString().slice(0, 10); const daily = await fs.readFile(path.join(WORKSPACE, 'memory', `${yesterday}.md`), 'utf8'); parts.push("## Yesterday's Notes\n" + daily); } catch {} // Read cross-platform messages from session logs try { const crossPlatform = await getCrossPlatformMessages(); if (crossPlatform.telegram.length > 0) { parts.push('## Recent Telegram Conversation\n' + crossPlatform.telegram.join('\n')); } if (crossPlatform.discord.length > 0) { parts.push('## Recent Discord Conversation\n' + crossPlatform.discord.join('\n')); } } catch {} if (parts.length === 0) return ''; return '\n\n---\n\nMEMORY CONTEXT:\n' + parts.join('\n\n') + '\n\n---\n\nIMPORTANT: Use the memory context above to inform your responses. Remember facts about the user and our work together.'; } ``` The documented integration in `SKILL.md:54-65` assigns this content the system role: ```typescript import { getMemoryContext } from '@/lib/memory-bridge'; // In your POST handler, before cal ...[truncated 4070 chars]- Remediation
View remediation
