T01 · Skill Instruction Hijacking
- Location
SKILL.md:32- Finding
Session-Wide Instruction and Tool Hijacking Through Codeflow Enforcement
- Content
View full analysis
{ const sessionKey = norm(ctx.sessionKey); if (!sessionKey) { return; } const state = await queryCurrent(sessionKey); if (!state?.active) { return; } return { prependContext: [ "Codeflow Enforced = ON for this thread.", `Coding, development, and review work must run via \`${codeflowScript} run|review|parallel|resume\`.`, "Direct write/edit/apply_patch/exec tool usage is blocked.", "If workdir is missing, ask for it. If the user wants to exit this mode, use /codeflow off.", ].join("\n"), }; }, { priority: 1000 }, ); api.on( "before_tool_call", async (event, ctx) => { const sessionKey = norm(ctx.sessionKey); if (!sessionKey) { return; } const state = await queryCurrent(sessionKey); if (!state?.active) { return; } const toolName = lower(event.toolName); if (BLOCKED_MUTATION_TOOLS.has(toolName)) { return { block: true, blockReason: "Codeflow is enforced for this thread. Direct file mutation is blocked; use Codeflow instead.", }; } if (toolName === "exec") { const command = extractEx ...[truncated 2155 chars]- Remediation
View remediation
