How does indirect prompt injection via email work?
Indirect prompt injection via email has five hops. The marker is [PLACEHOLDER INSTRUCTION]. It is not a payload.
| Hop | What happens |
|---|---|
| 1. Send | The marker sits in the body, a signature, or a hidden style. |
| 2. Deliver | The mailbox accepts it. SPF, DKIM, and DMARC can all pass. |
| 3. Ingest | An assistant loads that message from the inbox. |
| 4. Read | The model may follow the marker. |
| 5. Act | A summary, a link, an image fetch, a send, or a new verdict. |
SPF checks the sending server. DKIM checks a signature. DMARC checks that those two agree with the From domain. A domain owner, or a stolen account, can pass all three. None of them reads the words.
A gateway can block a known bad link and still pass a normal note. Immersive Labs (21 July 2025, updated 21 July 2026) showed hidden HTML that rebuilt a link. The gateway had not seen that link as one string. Hosts here are attacker.example.
SucuriLabs makes the same split: authentication names the sender, and the app still decides what the assistant may do. The definition stays on Indirect Prompt Injection in MCP. Dated cases are on Indirect Prompt Injection Examples (2023–2026).
Prompt injection in email: where the instruction hides
Prompt injection in email often hides beside a normal note. The person sees the note. The model receives the HTML. Each spot below matches a primary source from 06.10.2026. The marker never changes.
Styles a person does not see
These lines are defanged. Do not send them.
display:none
visibility:hidden
font-size:0
color:#ffffff on background:#ffffff
mso-hide:all
<!-- [PLACEHOLDER INSTRUCTION] -->
https://attacker.example/log
Immersive Labs, Insinuator (2 September 2025), Forcepoint (25 August 2026), and 0DIN (10 July 2025) used these tricks. The model still got the raw markup.
Quoted replies, signatures, and footers
A quoted reply, a signature, and a footer are visible. They can still hold the marker. Immersive Labs put lab text in a signature. Hiding is not required.
Attachments and calendar invites
Proofpoint (18 November 2025, updated 20 February 2026) names the body, an attachment, white text, and metadata. Google (13 June 2025) names emails, documents, and calendar invites. Radware (18 September 2025) names Outlook and Google invites with hidden HTML. No further attachment case is added here.
Payload fragmentation
Immersive Labs split a link so a scanner would miss the full URL. The joined host here would be attacker.example.
The form-notification path
A contact form is another door into that inbox. The visitor types a message, the host emails the owner, and an assistant summarizes the mail.
Formgong’s notification HTML escapes each field. Angle brackets, ampersands, and quotes become entities. A visitor cannot add a tag or a style. Hidden CSS from the form does not survive.
The plain-text part keeps the visitor’s words, one line per field. Bidi controls and most zero-width characters become a visible [U+XXXX] mark. The two joiners, U+200C and U+200D, stay as they are, because emoji sequences and scripts such as Persian and Hindi need them.
On every plan, including Free, each submission is emailed right away. Telegram is instant on every plan.
If a summary can send mail, the form sentence can name a recipient. Stop that in the send tool. Page setup is on Contact form not sending email. Telegram delivery is on Telegram bot for a contact form.
How EchoLeak turned one email into data exfiltration
EchoLeak is Aim Labs’ name for CVE-2025-32711 in Microsoft 365 Copilot. The short row and “What is EchoLeak?” stay on Indirect Prompt Injection Examples (2023–2026).
NVD, fetched on 06.10.2026, lists two CVSS 3.1 scores. The CNA score is 9.3, critical. NVD’s own score is 7.5, high. CNA scope is changed and integrity is low. NVD scope is unchanged and integrity is none. The CNA vector is AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:N. The NVD vector is AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N. This page does not pick one.
MSRC matches 9.3, critical, under “M365 Copilot Information Disclosure Vulnerability,” published 11 June 2025. exploited is No. No customer action is required. Microsoft says it was already fully mitigated. Aim Labs says no customers were affected, and names no May or June patch day. Simon Willison’s 11 June 2025 note says the January report’s fix was already rolled out.
The XPIA classifier bypass
XPIA means cross-prompt injection attack. Aim Labs says the classifiers were meant to stop injection text. The lab email spoke to the recipient. It never named AI, an assistant, or Copilot. That wording got past the classifier.
Reference-style Markdown
Ordinary Markdown links were redacted. Reference-style links were not. Here the URL is only https://attacker.example/log.
Auto-fetched images
A link needs a click. An image does not. A reference-style image skipped redaction and put Copilot context in the URL.
A Teams proxy the page already allowed
The image policy blocked attacker.example and allowed *.teams.microsoft.com. A Teams URL fetched another host for the client. The user did not accept an invite. This page does not print that path.
The server-side fix
There is no customer update to install. A chat-box filter would not have seen this email. Copilot retrieved it later, while answering some other question.
Other email prompt injection attacks
The cases below are the ones a primary page still supported on 06.10.2026.
Insinuator and an AI mail client on Gmail
On 2 September 2025, Florian Port, Malte Heinzelmann, and Florian Grunow tested Shortwave on Google Mail. Hidden HTML still reached the model. “Organize my inbox” and “Find urgent emails” run in bulk, and the bad message stays closed. read_webpage could send data to an attacker page. “Don’t ask again” is offered, and they call that likely. Reported 22 July 2025, confirmed the next day, gates on 14 August 2025. Most proposed changes were in. read_webpage was still open.
ShadowLeak and ChatGPT Deep Research
Radware’s 18 September 2025 post is by Zvika Babo and Gabi Nakibly, with Maor Uziel. One email made ChatGPT Deep Research leak Gmail data. Browsing was on. There was no further click. The fetch ran in OpenAI’s cloud, which they call service-side. Tiny fonts and white-on-white text hid the instructions. Success was 100 percent on the attack they tested. Bugcrowd received it on 18 June 2025, plus a variant the next day. OpenAI fixed it in early August, with no note to Radware, and resolved it on 3 September 2025. Outlook mail and calendar invites are named too.
Gemini email summaries
HiddenLayer (25 September 2024), by Jason Martin and Kenneth Yeung, covers Gemini for Workspace. White Gmail text and Slides speaker notes could steer a summary.
They write that Google “decided not to track it as a security issue and marked the ticket as ‘Won’t Fix (Intended Behavior)’.”
0DIN’s “Phishing For Gemini” (10 July 2025) is the same product. White-on-white text, or a zero font size, rides along with “Summarize this email.” Gemini then appends a warning. It looks as if Google wrote it. No link or attachment is required. The idea was public in 2024, mitigations were already out, and it still worked.
Google’s layered defense and the DeepMind paper
Google’s 13 June 2025 post names classifiers, security thought reinforcement, Markdown sanitizing, URL redaction, a confirm step, and a notice. External images are not rendered, so EchoLeak’s image fetch does not apply to Gemini. “More than 99.9 percent” is spam, phishing, and malware, not prompt injection. Google does not call the class closed.
DeepMind’s arXiv:2505.14534, submitted 20 May 2025, summarizes the latest email, which the sender can steer. Training alone does not fully solve this. Adversarial training is not sufficient by itself. Defense in depth is necessary.
Two lab proofs of concept
Immersive Labs (21 July 2025) hid a fragmented link in a signature. The CSS was font-size:0, white text, and mso-hide. A summary rebuilt the link. The gateway missed the pieces.
Forcepoint X-Labs (25 August 2026) used an unguarded Outlook add-in and claude-haiku-4-5 at temperature 0. They say it was not an attack on Outlook or that model. Hidden CSS was font-size:0px, white, and line-height:0. The mail showed 537 characters. The model saw 1,009, of which 472 were the injection. Ten trials each. The heading is “Injection Succeeded in All 10 Runs.”
| Outcome they scored | Clean | Injected |
|---|---|---|
| Summary states EUR 46,200 | 0/10 | 10/10 |
| Summary gives 3 Sep 2026 / 14:00 | 0/10 | 10/10 |
| Summary names the person in the visible mail | 10/10 | 0/10 |
| Summary states the 21 Aug 2026 deadline | 10/10 | 0/10 |
The injected amount was more than five times the real figure. Latency moved by about 0.5 to 1 second. None of those summaries mentioned the hidden notice. It is a lab test, not a field incident.
CVE-2024-5184 (EmailGPT) is direct injection
How to stop prompt injection through email
The tests run examples/email-to-model-guard.ts, shown below. No socket, no model call. You pass the HTML, the allow-list, and the Markdown. Three checks run in your code.
- Visible text.
extractVisibleEmailTextreturns the words a person would see, plus flags. It dropsdisplay:none,visibility:hidden,mso-hide:all, a zero font, up to 1px, and same-color text. It also drops HTML comments, zero-width characters, and bidi controls. A flag means the two texts disagree. Do not auto-run a tool. - Recipients.
checkSendRecipientchecksto,cc, andbccagainst a host allow-list. Mail text cannot add an address. An address off the list blocks the call. - Output sinks.
stripUnlistedOutputremoves Markdown images and links, including reference-style ones, whose host is not allowed. That is the EchoLeak sink. An image toattacker.exampleis deleted so the browser does not fetch it.
A filter is a signal, not a boundary. A visible signature line can still be obeyed. A summary needs no send tool. A send checks the exact recipient in code, and a person approves that call only. A new address needs a new yes. Egress stays on an allow-list. The collapsed sample is an output shape, not a request.
A check for any outbound URL, host, or recipient, on any tool, is on step-by-step prevention with a TypeScript policy layer. This page keeps the email-specific guard.
/**
* Keep an email from becoming a model instruction.
*
* extractVisibleEmailText returns the text a person would see, plus flags
* for hidden markup that was dropped. checkSendRecipient refuses any
* send_email address that is not on the host allow-list. The model cannot
* override that list: this function never reads a model message.
* stripUnlistedOutput removes Markdown images and links whose host is not
* on the allow-list. This file does not open a network connection and does
* not call a model.
*/
export const HIDDEN_FLAGS = [
"display-none",
"visibility-hidden",
"near-zero-font",
"same-color-text",
"mso-hide",
"html-comment",
"zero-width",
"bidi-override",
] as const;
export type HiddenFlag = (typeof HIDDEN_FLAGS)[number];
export type VisibleEmail = {
text: string;
flags: HiddenFlag[];
};
export type SendEmailCall = {
to?: unknown;
cc?: unknown;
bcc?: unknown;
};
export type RecipientDecision =
| { allowed: true; recipients: string[] }
| { allowed: false; rejected: string[]; message: string };
export type RemovedOutput = {
kind: "image" | "link";
host: string;
};
export type OutputDecision = {
text: string;
removed: RemovedOutput[];
};
export class EmailGuardError extends Error {
constructor(message: string) {
super(message);
this.name = "EmailGuardError";
}
}
const ZERO_WIDTH = /[\u200B\u200C\u200D\u2060\uFEFF\u180E]/;
const BIDI = /[\u202A-\u202E\u2066-\u2069]/;
const EMAIL = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/;
const VOID_TAGS = new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "source", "track", "wbr"]);
const SKIP_TAGS = new Set(["script", "style", "noscript", "head", "title"]);
const BLOCK_TAGS = new Set(["p", "div", "li", "tr", "blockquote", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "section", "article", "table"]);
type Frame = {
tag: string;
hidden: boolean;
color: string | null;
background: string | null;
};
function requireString(value: unknown, label: string): string {
if (typeof value !== "string") throw new EmailGuardError(`${label} must be a string.`);
return value;
}
function normalizeColor(value: string): string | null {
const raw = value.trim().toLowerCase().replace(/\s+/g, "");
const named: Record<string, string> = {
white: "#ffffff",
black: "#000000",
transparent: "transparent",
};
if (named[raw]) return named[raw];
const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/.exec(raw);
if (hex) {
const body = hex[1]!;
const full = body.length === 3 ? body.split("").map((part) => part + part).join("") : body;
return `#${full}`;
}
const rgb = /^rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(?:,[\d.]+)?\)$/.exec(raw);
if (!rgb) return null;
const parts = [rgb[1], rgb[2], rgb[3]].map((part) => Math.min(255, Number(part)).toString(16).padStart(2, "0"));
return `#${parts.join("")}`;
}
function nearZeroFont(value: string): boolean {
const match = /^(-?\d*\.?\d+)(px|pt|em|rem|%)?$/.exec(value.trim().toLowerCase());
if (!match) return false;
const amount = Number(match[1]);
const unit = match[2] ?? "";
if (!Number.isFinite(amount) || amount < 0) return false;
if (amount === 0) return true;
return unit === "px" && amount <= 1;
}
function styleFlags(style: string): { flags: HiddenFlag[]; color: string | null; background: string | null } {
const flags: HiddenFlag[] = [];
let color: string | null = null;
let background: string | null = null;
for (const decl of style.split(";")) {
const split = decl.split(":");
if (split.length < 2) continue;
const prop = split[0]!.trim().toLowerCase();
const value = split.slice(1).join(":").trim().toLowerCase();
if (prop === "display" && value === "none") flags.push("display-none");
if (prop === "visibility" && (value === "hidden" || value === "collapse")) flags.push("visibility-hidden");
if (prop === "mso-hide" && value === "all") flags.push("mso-hide");
if (prop === "font-size" && nearZeroFont(value)) flags.push("near-zero-font");
if (prop === "color") color = normalizeColor(value);
if (prop === "background-color") background = normalizeColor(value.split(" ")[0] ?? value);
if (prop === "background") {
const found = value.split(/\s+/).map(normalizeColor).find((item) => item && item !== "transparent");
if (found) background = found;
}
}
return { flags, color, background };
}
function decodeEntities(value: string): string {
return value
.replace(/&#x([0-9a-f]+);/gi, (_, hex: string) => safeCodePoint(Number.parseInt(hex, 16)))
.replace(/&#(\d+);/g, (_, num: string) => safeCodePoint(Number(num)))
.replace(/ /gi, " ")
.replace(/"/gi, '"')
.replace(/'|'/gi, "'")
.replace(/</gi, "<")
.replace(/>/gi, ">")
.replace(/&/gi, "&");
}
function safeCodePoint(code: number): string {
if (!Number.isFinite(code) || code < 0 || code > 0x10ffff) return "";
try {
return String.fromCodePoint(code);
} catch {
return "";
}
}
function stripControls(value: string, flags: Set<HiddenFlag>): string {
let next = value;
if (ZERO_WIDTH.test(next)) {
flags.add("zero-width");
next = next.replace(new RegExp(ZERO_WIDTH, "g"), "");
}
if (BIDI.test(next)) {
flags.add("bidi-override");
next = next.replace(new RegExp(BIDI, "g"), "");
}
return next;
}
function readAttributes(source: string): { style: string; selfClosing: boolean } {
let style = "";
const selfClosing = /\/\s*$/.test(source.trim());
const attr = /([:\w-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+))/g;
let match: RegExpExecArray | null;
while ((match = attr.exec(source))) {
if (match[1]!.toLowerCase() !== "style") continue;
style = match[2] ?? match[3] ?? match[4] ?? "";
}
return { style, selfClosing };
}
function collapseText(value: string): string {
return value
.replace(/[ \t]+\n/g, "\n")
.replace(/[ \t]{2,}/g, " ")
.replace(/\n{3,}/g, "\n\n")
.trim();
}
/** Visible text from an HTML email, and the hide techniques that were dropped. */
export function extractVisibleEmailText(html: string): VisibleEmail {
const source = requireString(html, "html");
const flags = new Set<HiddenFlag>();
const stack: Frame[] = [{ tag: "#root", hidden: false, color: null, background: null }];
let text = "";
let index = 0;
const hiddenNow = () => stack.some((frame) => frame.hidden);
const current = () => stack[stack.length - 1]!;
while (index < source.length) {
if (source.startsWith("<!--", index)) {
flags.add("html-comment");
const end = source.indexOf("-->", index + 4);
index = end === -1 ? source.length : end + 3;
continue;
}
// <!doctype …>, <?xml …?> and <![endif]> are markup, not text: skip them whole.
if (source[index] === "<" && /^[!?]/.test(source[index + 1] ?? "")) {
const end = source.indexOf(">", index + 2);
index = end === -1 ? source.length : end + 1;
continue;
}
if (source[index] === "<" && /^[a-zA-Z/]/.test(source[index + 1] ?? "")) {
const end = source.indexOf(">", index + 1);
if (end === -1) break;
const raw = source.slice(index + 1, end).trim();
index = end + 1;
const closing = raw.startsWith("/");
const name = (closing ? raw.slice(1) : raw).split(/\s+/)[0]?.toLowerCase().replace(/\/$/, "") ?? "";
if (!name) continue;
if (closing) {
for (let depth = stack.length - 1; depth > 0; depth -= 1) {
const frame = stack[depth]!;
stack.pop();
if (!frame.hidden && BLOCK_TAGS.has(frame.tag)) text += "\n";
if (frame.tag === name) break;
}
continue;
}
const attrs = readAttributes(raw);
const styled = styleFlags(attrs.style);
for (const flag of styled.flags) flags.add(flag);
const parent = current();
const color = styled.color ?? parent.color;
const background = styled.background ?? parent.background;
let hidden = parent.hidden || styled.flags.length > 0 || SKIP_TAGS.has(name);
if (color && background && color !== "transparent" && color === background) {
flags.add("same-color-text");
hidden = true;
}
if (!attrs.selfClosing && !VOID_TAGS.has(name)) {
stack.push({ tag: name, hidden, color, background });
} else if (!hidden && name === "br") {
text += "\n";
}
continue;
}
// A "<" that opens no tag ("2 < 3", "<3") is text; search past it or the loop never moves.
const next = source.indexOf("<", source[index] === "<" ? index + 1 : index);
const chunk = source.slice(index, next === -1 ? source.length : next);
index = next === -1 ? source.length : next;
if (!hiddenNow() && chunk) text += stripControls(decodeEntities(chunk), flags);
}
return { text: collapseText(text), flags: HIDDEN_FLAGS.filter((flag) => flags.has(flag)) };
}
function normalizeEmail(value: string): string {
return value.trim().toLowerCase();
}
function readAddresses(value: unknown, label: string): string[] {
if (value === undefined || value === null) return [];
const list = Array.isArray(value) ? value : [value];
return list.map((item, index) => {
if (typeof item !== "string") throw new EmailGuardError(`${label}[${index}] must be a string.`);
const email = normalizeEmail(item);
if (!EMAIL.test(email)) throw new EmailGuardError(`${label}[${index}] is not an email address.`);
return email;
});
}
/**
* Allow-list check for a send_email tool call.
* `allowList` comes from host configuration. A model message cannot change it.
*/
export function checkSendRecipient(call: SendEmailCall, allowList: readonly string[]): RecipientDecision {
if (!call || typeof call !== "object") throw new EmailGuardError("send_email call must be an object.");
if (!Array.isArray(allowList)) throw new EmailGuardError("allowList must be an array.");
const allowed = new Set(allowList.map((item, index) => {
if (typeof item !== "string") throw new EmailGuardError(`allowList[${index}] must be a string.`);
const email = normalizeEmail(item);
if (!EMAIL.test(email)) throw new EmailGuardError(`allowList[${index}] is not an email address.`);
return email;
}));
const recipients = [
...readAddresses(call.to, "to"),
...readAddresses(call.cc, "cc"),
...readAddresses(call.bcc, "bcc"),
];
if (!recipients.length) {
return { allowed: false, rejected: [], message: "send_email needs at least one recipient." };
}
const rejected = recipients.filter((email) => !allowed.has(email));
if (rejected.length) {
return {
allowed: false,
rejected,
message: "Recipient is not on the allow-list. The model cannot add one.",
};
}
return { allowed: true, recipients };
}
function hostOf(url: string): string | null {
try {
const parsed = new URL(url);
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return "";
return parsed.hostname.toLowerCase();
} catch {
return "";
}
}
function allowedHost(host: string, allowHosts: ReadonlySet<string>): boolean {
return host !== "" && allowHosts.has(host);
}
/**
* Strip Markdown images, and links whose host is not on the allow-list.
* Reference-style definitions are removed with the image or link that uses them.
*/
export function stripUnlistedOutput(markdown: string, allowHosts: readonly string[]): OutputDecision {
const source = requireString(markdown, "markdown");
if (!Array.isArray(allowHosts)) throw new EmailGuardError("allowHosts must be an array.");
const hosts = new Set(allowHosts.map((host, index) => {
if (typeof host !== "string" || host.trim() === "") throw new EmailGuardError(`allowHosts[${index}] must be a host name.`);
return host.trim().toLowerCase().replace(/\.$/, "");
}));
const removed: RemovedOutput[] = [];
const definitions = new Map<string, { host: string; url: string }>();
const withoutDefinitions = source.replace(/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*<?(https?:\/\/[^>\s]+)>?[^\n]*$/gim, (line, id: string, url: string) => {
const host = hostOf(url) ?? "";
definitions.set(id.trim().toLowerCase(), { host, url });
if (!allowedHost(host, hosts)) {
removed.push({ kind: "link", host: host || "unparsed" });
return "";
}
return line;
});
return {
text: replaceMarkdown(withoutDefinitions, definitions, hosts, removed).replace(/[ \t]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim(),
removed,
};
}
function readBracket(source: string, start: number): { inner: string; end: number } | null {
if (source[start] !== "[") return null;
const end = source.indexOf("]", start + 1);
if (end === -1) return null;
return { inner: source.slice(start + 1, end), end: end + 1 };
}
function readParen(source: string, start: number): { inner: string; end: number } | null {
if (source[start] !== "(") return null;
let depth = 0;
for (let index = start; index < source.length; index += 1) {
if (source[index] === "(") depth += 1;
else if (source[index] === ")") {
depth -= 1;
if (depth === 0) return { inner: source.slice(start + 1, index).trim(), end: index + 1 };
}
}
return null;
}
function destinationHost(destination: string, definitions: Map<string, { host: string; url: string }>, label: string, inline: boolean): { host: string; known: boolean } {
const trimmed = destination.trim();
if (inline) {
const url = trimmed.split(/\s+/)[0] ?? "";
if (url.startsWith("http://") || url.startsWith("https://")) return { host: hostOf(url) ?? "", known: true };
return { host: "", known: true };
}
const key = (trimmed || label).trim().toLowerCase();
const found = definitions.get(key);
if (!found) return { host: "", known: false };
return { host: found.host, known: true };
}
function replaceMarkdown(
source: string,
definitions: Map<string, { host: string; url: string }>,
hosts: ReadonlySet<string>,
removed: RemovedOutput[],
): string {
let out = "";
for (let index = 0; index < source.length; index += 1) {
const image = source.startsWith("![", index);
const bracketAt = image ? index + 1 : index;
if ((image || source[index] === "[") && source[index - 1] !== "!") {
const label = readBracket(source, bracketAt);
if (label) {
const paren = source[label.end] === "(" ? readParen(source, label.end) : null;
const ref = !paren && source[label.end] === "[" ? readBracket(source, label.end) : null;
if (paren || ref) {
const looked = destinationHost(paren ? paren.inner : ref!.inner, definitions, label.inner, Boolean(paren));
const end = paren ? paren.end : ref!.end;
if (!looked.known) {
out += source.slice(index, end);
index = end - 1;
continue;
}
if (allowedHost(looked.host, hosts)) {
out += source.slice(index, end);
} else {
removed.push({ kind: image ? "image" : "link", host: looked.host || "unparsed" });
if (!image) out += label.inner;
}
index = end - 1;
continue;
}
}
}
out += source[index];
}
return out;
}
What the module printed for a hidden marker and a blocked send
visible text: Please quote the patio. flags: display-none send_email to stranger@attacker.example: blocked, not on the allow-list model output: See the note. removed image host: attacker.example
Checklist for wiring Gmail or Outlook into an AI agent
- Give the summary a read scope. Do not put send on that token.
- Pass visible text and hide flags. Keep raw HTML away from the model.
- If a hide flag is set, do not auto-run tools. Show a person the mismatch.
- Allow-list
to,cc, andbccin code. The model cannot extend the list. - Approve the exact recipient and body. One yes does not cover the next call.
- Strip images and links to any host you did not allow, before the reply renders.
- Skip bulk inbox jobs unless a person opened that message.
- Keep SPF, DKIM, and DMARC for sender checks. A pass is not a clean prompt.
- Log the tool name and the recipient. Do not copy the full message to a shared log.
- Treat a form notification as the same untrusted text. Escaped HTML stops markup, not the assistant.
What the guard caught and missed in our test
On 12 October 2026 we wrote a short quote request and hid one line in it four ways: display:none, white on a white background, font-size:0 and an HTML comment. The line asked an assistant to forward the thread to sink@attacker.example. The guard's 9 tests passed.
Our first run never returned. The email started with <!doctype html>, as most HTML mail does, and the parser only moved on when a < opened a tag or a comment. <?xml, <![endif]>, 2 < 3 and thanks <3 hung it the same way. We fixed the parser that day and added such an email to its tests; the code above is the fixed version. The same email now takes 1 ms.
The guard kept the greeting, the request and the signature, dropped the hidden line, and returned ["display-none","near-zero-font","same-color-text","html-comment"].
Then we tried one trick per email. These kept the hidden line and raised no flag:
display: none !important- a
.x{display:none}rule in a<style>block - white text where the white comes from
bgcoloror<font color> #fefefeon#ffffff, andfont-size:2pxopacity:0,height:0;overflow:hiddenandleft:-9999px
A normal invoice with a hidden preheader was flagged display-none, so a flag alone does not mean an attack. The other two checks did what this page says: sink@attacker.example in bcc was rejected, and a reference-style image to attacker.example was removed. Treat the visible-text step as a signal with known gaps, and keep the recipient check in code.
What Formgong does about this
Formgong is a free form backend for static and AI-built sites that delivers submissions to Telegram and email, stores data in the EU, and works in 12 languages. On every plan, including Free, each submission is emailed and Telegram is instant. That does not make prompt injection impossible.
Notification HTML escapes fields, as above. Telegram is HTML with those fields escaped, so they cannot become tags. Both channels still carry the visitor’s words. No model sits on delivery.
The MCP server, checked on 06.10.2026 against this repo and llms.txt, uses authorization code with PKCE S256. A token is issued only for this server’s MCP URL. Reading submissions needs the opt-in scope submissions:read. The tool says those fields are untrusted data, never instructions, and the result repeats the notice. No MCP tool sends mail.
The notice is a label. Gmail or Outlook beside it is another token, so the text can still sit in context. Plans are on the pricing page. Other injection types are on Types of Injection Attacks on Web Forms (2026). Write to support@formgong.com.
Frequently asked questions
Can an email contain a prompt injection?
Yes. Instructions can sit in the body, in hidden HTML or CSS, in a signature, or in text loaded later. EchoLeak, CVE-2025-32711, was one such email to Microsoft 365 Copilot. SPF, DKIM, and DMARC do not remove it.
What is an email prompt injection example?
A visible note says please quote the patio. A hidden block holds [PLACEHOLDER INSTRUCTION]. A summarizer that receives the raw HTML can follow that block. This page uses only that marker and attacker.example.
Does Gemini have email prompt injection protection?
Google’s 13 June 2025 post names classifiers, security thought reinforcement, Markdown sanitizing, URL redaction, a confirm step, and a notice. External images are not rendered, so EchoLeak’s fetch does not apply. Google does not call the class closed. DeepMind’s 20 May 2025 paper says training alone is not a full fix.
Do SPF, DKIM, and DMARC stop prompt injection?
No. They check the sender and the signature. An allowed domain can still carry instructions. Treat the body as data, and let the send tool enforce its own allow-list.
What is an email prompt injection attack?
It is the five-hop path on this page. Mail is accepted, an assistant ingests it, and the model follows text inside it. A tool or a rendered link can then send data out. The weak point is tool scope, not the spam check.
Sources and documentation
Official references for this guide: NVD: CVE-2025-32711 (fetched 6 October 2026), MSRC: CVE-2025-32711, Aim Labs EchoLeak write-up (Cato Networks), Simon Willison: EchoLeak note (11 June 2025), Insinuator: stealing emails via prompt injections (2 September 2025), Radware: ShadowLeak (18 September 2025), HiddenLayer: Gemini for Workspace (25 September 2024), 0DIN: Phishing For Gemini (10 July 2025), Google: layered prompt-injection defense (13 June 2025), Google DeepMind, arXiv:2505.14534 (submitted 20 May 2025), SucuriLabs: how email is used for prompt injection (28 July 2026), Immersive Labs: weaponizing LLMs through email (21 July 2025), Forcepoint X-Labs: HTML payload and an email summarizer (25 August 2026), Proofpoint: indirect prompt injection and email (18 November 2025), CVE-2024-5184, NVD: CVE-2024-5184. Formgong MCP server, where data is stored.
Related guides
- Lovable form submissions to email and Telegram
- HTML contact form without a backend: a working example
- How to send website form submissions to Telegram
- Contact form not sending email? Check where it stops
- Managing website leads in Telegram without a CRM
- Form backend for Lovable, Bolt, v0, Cursor
- Telegram bot for a contact form: build or skip?
- GDPR form backend: 7 checks before you choose
- Lovable form not sending email? 6 fixes
- Netlify Forms not working? React and Bolt fixes
- Stop contact form spam without a CAPTCHA
- GitHub Pages contact form: a working setup
- Mailto Form in HTML: Why It Fails and What to Use
- HTML form to Google Sheets: 2 free methods
- Webflow form submission limit: what to do at 50
- Turnstile vs reCAPTCHA vs hCaptcha for forms
- Contact Form 7 and Elementor forms to Telegram
- Squarespace contact form not sending email?
- Shopify contact form: where do messages go?
- Google Form to Telegram: free Apps Script way
- Wix contact form not sending email? Fixes
- EU / GDPR Formspree alternatives compared
- HTML form action attribute explained
- How do HTML forms work? The HTTP request
- Types of Injection Attacks on Web Forms (2026)
- Indirect Prompt Injection in MCP
- MCP Rug Pull Attack: Detect Tool Changes
- Form without a backend: 7 ways that work
- Thank-you page after form submission (HTML)
- Indirect Prompt Injection Examples (2023–2026)
- What Is Tool Poisoning in MCP?
- WordPress contact form without a plugin
- Send email from frontend JavaScript
- How to Prevent Indirect Prompt Injection
- Honeypot Form Field: How to Add One That Works
- Contact Form with File Upload (HTML, No PHP)
- Angular contact form without a backend
- Send form submissions to Slack or Discord without Zapier
- Verify a form webhook signature (HMAC-SHA256)
- Contact forms that send nothing: 793 AI-built sites tested
- v0 contact form that actually sends: 3 ways
- How we tested AI-built contact forms, and 12 bugs we hit
- Cloudflare vs Netlify free plan: hosting that never pauses
- EmailJS 412 “Gmail_API: Invalid grant”: reconnect Gmail
- Resend “You can only send testing emails”: verify a domain
- Supabase Edge Function blocked by CORS policy: 3 causes
- Formspree “Form not found” and other errors: fixes
- Web3Forms errors: “Invalid access key” and 403 explained
- How to add customer reviews to your website for free
- Getform not working? “This form has been deleted” and more
- Next.js contact form not working? 6 errors, reproduced
- Webflow form not sending email? What to check, tested
- FormSubmit not working? “This form needs Activation” fix
- Contact form “TypeError: Failed to fetch”: causes and fixes
- WooCommerce product enquiry form
- Contact Form 7 vs WPForms
- Gravity Forms alternative free
- WordPress contact form block
- 535-5.7.8 Username and Password not accepted (Gmail)
- 535 5.7.3 Authentication unsuccessful: Office 365 SMTP
- Nodemailer “Missing credentials for "PLAIN"”: the fix
- Nodemailer “Greeting never received”: port 465 fix
- Nodemailer SSL “wrong version number”: the port fix
- Nodemailer “self-signed certificate in certificate chain”
- Nodemailer ECONNREFUSED 127.0.0.1:587: missing SMTP host
- SendGrid “authorization grant is invalid”: 401 fix
- Mailgun 401 Forbidden: why the API rejects your key
- “Edge Function returned a non-2xx status code”: the fix
- Next.js “Body exceeded 1 MB limit”: Server Action fix
- Unexpected token '<', "<!DOCTYPE "... is not valid JSON
- “TypeError: Body is unusable”: body has already been read
- Turnstile “timeout-or-duplicate” and other siteverify errors
- Turnstile vs hCaptcha vs reCAPTCHA: speed and size tested
- Judge.me reviews not showing on Shopify: how to fix it
- Judge.me review carousel not showing: how to fix it
- Yotpo reviews not showing on Shopify? Check the app embed
- Loox reviews not showing on product page: how to fix
- Shopify reviews not showing: what to check first
- How to show reviews on Shopify
- GDPR for website forms: what each type of form needs
- WooCommerce reviews not showing: how to fix it
- Stamped.io reviews not showing on Shopify: how to fix it
- Etsy reviews not showing: why and what to do
- Trustpilot widget not loading: how to fix TrustBox
- Yotpo problems in 2026: what merchants report
- Contact Form 7 “error trying to send your message” fix
- Elementor form “Your submission failed because of an error”
- Framer form not sending email or not working: what to check
- Carrd contact form not working: plans, spam and errors
- Google review link not working: what customers see and why
- tawk.to widget not showing on your website: causes and fixes
- How to add questions and answers to your product page
- “Failed to send a request to the Edge Function”: fixes
- Next.js “Failed to find Server Action”: what it means
- Brevo “unauthorized: Key not found” 401: the fix
- Amazon SES “Email address is not verified”: the fix
- Shopify contact form not working: how to fix it
- Judge.me alternative for WooCommerce after the 2025 shutdown
- Free WooCommerce review plugins compared on the free version
- WooCommerce review reminder emails without a paid plugin
- Add Voice Recording to a Website Form
- Contact Form 7 spam: how to stop it
- WPForms not sending email: how to fix it
- Contact form emails going to spam: how to fix it
- HTML form not submitting: how to fix it
- Contact form not working: how to find the fault
- Webflow form spam: how to stop it
- Website form to Notion: how to set it up
- Website form to WhatsApp: what works and what does not
- What 1-star reviews say about AI support chatbots
- Which free form backend gives you the most submissions?
- Elfsight reviews widget not showing? Check the view limit
- Next.js contact form backend vs Server Actions
- Review stars not showing in Google search results
- How to stop duplicate form submissions
- How to see which form leads came from ChatGPT
- What happens when a form webhook fails
- When to send a review request email after an order
- How to collect video testimonials for free
- Add contact form sign-ups to Mailchimp or Klaviyo
- How to migrate from Formspree without losing submissions
- How to get a Google review link for your business
- What is a headless form backend?
- Is it safe to put a form access key in your HTML?
- AI chatbot that answers only from your website
- Minified React error #441 in Next.js
- Squarespace product reviews after Judge.me
- Accessible contact form checklist for WCAG 2.2
- How to ask a client for a testimonial by email
- How to respond to negative reviews, with examples
- 429 Too Many Requests on a contact form
- MCP server for forms in Cursor and Claude
- Can you offer a discount for a review?
- Do EU stores have to say if reviews are verified?
- Webflow form backend options compared
- How to add review schema JSON-LD to a product page
- How to turn a customer review into an Instagram post
- How to make a QR code for Google reviews
- Live chat or chatbot for a small business website
- Why people abandon your contact form halfway
- Which form backend do AI assistants pick? 54 answers
- PHP mail() not sending email, even when it returns true
- What “Failed to fetch” means, tested in three browsers
- 405 Method Not Allowed when you submit a form
- Send a contact form to more than one email address
- What is review syndication, and who needs it?
- How to save HTML form data to a database
- NetworkError when attempting to fetch resource
- Send product reviews to Google Merchant Center
- PHPMailer not working on a live server
- AI review reply generator: does it help?
- React 19 contact form with useActionState
- Astro Actions or a form backend?
- Is no-reply@wixsiteautomations.com legit?
- Where to find the Judge.me review widget code
- AI review summaries: what shoppers actually see
- Photo reviews for WooCommerce, and the GPS inside them
- Review request email templates you can copy
- Reviews in AI search: what ChatGPT and Perplexity cite
- Lead capture form with UTM tracking, built and tested
- Form design best practices, with our own form data
- Client intake form template with file upload
- What is social proof? Meaning and examples
- What is user-generated content (UGC)?
- Benefits of negative reviews for your store
- How to get your first reviews as a new store
- How to use customer reviews in your marketing
- How to get more customer reviews
- React form validation without a library, tested
- jQuery submit form with validation
- reCAPTCHA v3 setup with the server score check
- Shopify social proof that shoppers can check
- HTML file input: accept, multiple, capture and size checks
- How to add hCaptcha to a form, with the server check
- How to add invisible reCAPTCHA to a form
- Bug report form template with browser details
- What the FTC fake reviews rule bans for online stores
- How to show reviews on your homepage
- Do reviews increase sales? What the studies show
- HTML input types and what each one sends
- HTML textarea, tested in a real form
- HTML dropdown menu in a form, tested
- Do reviews help SEO? What Google says and shows
- How to add a review carousel people can read
- Product review examples that help shoppers decide
- Which trust badges actually mean something
- Customer satisfaction survey with CSAT and NPS
- JavaScript FormData and what fetch actually sends
- JavaScript form validation without a library
- Server-side form validation and what it catches
- Email validation in JavaScript, tested on 33 addresses
- Zod form validation with FormData, tested
- Store reviews vs product reviews
- How to send review requests through Klaviyo
- How to tag customer reviews by topic and mood
- Custom review form questions worth asking
- Online reputation management for small businesses
- HTML radio button groups and what they send
- HTML label tag and what screen readers hear
- HTML autocomplete attribute, tested with Chrome autofill
- HTML fieldset and legend, and what disabled leaves out
- HTML button tag and what a form button sends
- Vite contact form that still works after the build
- How to test a contact form, end to end
- How to embed a Google Form, and what it loads
- Customer feedback questions that get real answers
- How to convert a file to base64 in JavaScript
- FilePond with a form backend, and when to skip it
- Bootstrap form validation and server errors
- Tailwind form validation, tested in three browsers
- Donation form in HTML, and where the payment goes
- How to ask for a review in person or by text
- Which review sites matter for your business
- What are customer reviews, and which kinds count
- Online review statistics, checked at the source
- Best review app for Shopify and WooCommerce
- Why Gmail sends your self-hosted mail to spam
- htmx contact form that sends to another domain
- AI form builders tested, from prompt to sent form
- Headless WordPress forms with Contact Form 7, tested
- React Hook Form watch vs useWatch, and what gets sent
- Elfsight widget not working? It vanishes when views run out
- Jotform not sending emails? Check Jotform's bounce list
- Typeform not working? A white box means a blocked script
- Positive review response examples that don't sound copied
- How to remove a Google review when you can't delete it
- Google reviews not showing up? 8 causes to check in order
- Is buying Google reviews illegal? Even a review swap counts
- Which reviews can you hide? A review moderation checklist
- Average star rating: what 4.8 from 5 reviews means
- Reviews on a product page: where and how many to show
- SaaS testimonials: 3 of 27 had a number in them
- Do reviews reduce returns? Not when they're too good
- Testimonial examples for business: what makes one believable
- Testimonial questions to ask clients, by type of business
- Testimonial page design: a page or a section?
- Testimonial advertising rules: what the FTC requires
- Form submission canceled because the form is not connected
- Input type date format dd/mm/yyyy: what you can change
- How to disable textarea resize, or allow only vertical
- How to prevent Enter from submitting a form
- form.submit() vs requestSubmit(): what submit() skips
- Custom HTML checkbox CSS that doesn't break required
- How to reset a form after submit, and what reset() keeps
- Input type number maxlength not working? What to use
- How to create an HTML form, step by step
- Best form builder: free plans and branding, checked
- Best WordPress contact form plugin: 10 free ones compared
- How to increase form conversion rate: start with the count
- Form backend vs form builder: which one do you need?
- WordPress contact form not sending email? 3 plugins tested
- Contact Form 7 webhook? Turning it on switched our email off
- Gravity Forms webhook: what it sends and the URLs it rejects
- Failed to set the 'value' property on 'HTMLInputElement'
- ERROR for site owner: Invalid domain for site key
- Contact form auto reply that bots can't turn into spam
- Best Shopify review apps: 11 compared on what's free
- Google review cards: what the NFC chip really opens
- Contact Form 7 not sending email? 5 causes we tested