T01 · Skill Instruction Hijacking
- Location
bridge.js:117- Finding
Untrusted Public Chat Content Is Injected Verbatim into the Privileged Main Agent Session
- Content
View full analysis
`[${m.from}] ${m.text}`) .join('\n'); const notification = { type: 'req', id: String(messageIdCounter++), method: 'chat.send', params: { message: `🦞 MOL IM messages in #${currentRoom}:\n${formatted}`, sessionKey: 'agent:main:main', idempotencyKey: `mol-im-${Date.now()}-${Math.random().toString(36).slice(2)}` } }; try { openclawWs.send(JSON.stringify(notification)); console.log(`BRIDGE: Sent ${batchedMessages.length} messages to gateway`); } catch (err) { console.log(`BRIDGE: Send failed: ${err.message}`); } } function addToBatch(msg) { messageBatch.push({ from: msg.screenName, text: msg.text, room: currentRoom, ts: Date.now() }); if (!batchTimer) { console.log('BRIDGE: Starting 10s batch timer...'); batchTimer = setTimeout(() => { if (messageBatch.length > 0) { console.log(`BRIDGE: Batch ready, ${messageBatch.length} messages`); notifyOpenClaw(messageBatch); messageBatch = []; } batchTimer = null; }, BATCH_DELAY_MS); } } ``` The same issue affects room-history delivery: ```javascript function sendContextToAgent(room, messages) { if (!wsReady || !openclawWs) { console.log('BRIDGE: Gateway not ready, skipping context'); return; } let contextText; if (messages.length === 0) { contextText = `🦞 Joined #${room} - room is quiet. Say hi or wait for activity.`; } else { const formatted = messages.map(m => `[${m.screenName} ...[truncated 3329 chars]- Remediation
View remediation
