T01 · Skill Instruction Hijacking
- Location
scripts/unified_mailbox_ai.py:307- Finding
Untrusted Email Content Is Passed to a Tool-Capable AI Agent
- Content
View full analysis
--no-input' if GMAIL_ENABLED else '' ) # Prompt sent to the AI; output must be in English (the bot reply language) email_summary = json.dumps(new_emails, ensure_ascii=False, indent=2) message = f"""Process these {len(new_emails)} new unread email(s). Do everything silently — no step headers, no internal notes, no follow-up questions. Output ONLY the final notification block in English. DO SILENTLY (no output for these): {gmail_body_line} - For any is_meeting_invite=true, check the configured calendar(s): {calendar_block} - Mark every email: python3 {__file__} mark --id "" OUTPUT (exactly this format, nothing else, all in English): 📬 {len(new_emails)} new email(s) [One block per email:] [Outlook/Gmail] From: Subject: Summary: <1-2 sentence summary in English> [Only if is_meeting_invite=true] Event time: | ⚠️ Conflicts with "" / ✅ No conflict Emails: {email_summary}""" result = subprocess.run([ OPENCLAW_BIN, 'agent', '--message', message, '--deliver', '--to', TELEGRAM_USER ]) ``` ### Technical Analysis Sender-controlled email fields are serialized directly into the instruction context passed to an OpenClaw agent. These fields include senders, subjects, Outlook body previews, and potentially full Gmail bodies fetched by the agent. The prompt does not provide an enforceable trust boundary between system instructions and mailbox content. Text in an email can therefore masquerade as a new instruction. The invoked agent is also instructed to run mailbox, calendar, and local Python commands, while the Skill declares Bash, Read, and Write capabilities. Pr ...[truncated 1361 chars]- Remediation
View remediation
