other
- Location
scripts/outlook-mail-fetch.mjs:314- Finding
Indirect Prompt Injection Through Untrusted Mailbox Content in Generated Markdown
- Content
View full analysis
| **Date:** ${d}\n`; if (attList && attList.length > 0) { md += `**Attachments:** ${attList.map(a => `${a.name} (${(a.size / 1024).toFixed(0)}KB)`).join(', ')}\n`; } md += `> ${(e.preview || '').slice(0, 250).replace(/\n/g, ' ')}\n\n`; } ``` ### Technical Analysis The generated `email-summary.md` incorporates externally controlled mailbox fields, including: - Message subjects - Sender names and addresses - Attachment names - Message previews These values are inserted directly into Markdown without escaping Markdown or HTML metacharacters, applying structural delimiters, or attaching provenance metadata that identifies them as untrusted data. An external sender can consequently place headings, links, HTML, or instruction-like text into the generated report. Although this does not directly execute operating-system code, it creates an indirect prompt-injection boundary when an AI Agent later reads or analyzes the report. The Agent may interpret mailbox content as instructions rather than as untrusted data. The preview is truncated and has newline characters replaced, but that does not neutralize prompt injection or inline Markdown/HTML. Subjects, sender fields, and attachment names are not similarly constrained in the displayed code. ### Attack Path 1. An attacker sends an email to the target mailbox. 2. The attacker places instruction-like content or crafted Markdown/HTML i ...[truncated 1354 chars]- Remediation
View remediation
