Microsoft 365 Copilot Vulnerability Enables Data Exfiltration via Prompt Injection

A recently identified vulnerability in Microsoft 365 Copilot (M365 Copilot) has raised significant security concerns, as it allows attackers to exfiltrate sensitive tenant data, including recent emails, through indirect prompt injection attacks. This flaw exploits the AI assistant’s integration with Office documents and its support for Mermaid diagrams, facilitating data theft with minimal user interaction.

Understanding the Vulnerability

The attack initiates when a user requests M365 Copilot to summarize a maliciously crafted Excel spreadsheet. Within this spreadsheet, hidden instructions are embedded in white text across multiple sheets. These instructions employ progressive task modification and nested commands to manipulate the AI’s behavior. As a result, the summarization task is overridden, directing Copilot to invoke its `search_enterprise_emails` tool to retrieve recent corporate emails. The extracted content is then hex-encoded and fragmented into short lines to circumvent Mermaid’s character limitations.

Exploitation via Deceptive Diagrams

Copilot subsequently generates a Mermaid diagram—a JavaScript-based tool for creating flowcharts and charts from Markdown-like text—that masquerades as a login button secured with a lock emoji. This diagram includes CSS styling to convincingly appear as a legitimate button and contains a hyperlink embedding the encoded email data.

When the user clicks this deceptive login button, believing it is necessary to access the document’s sensitive content, the link directs them to the attacker’s server, such as a Burp Collaborator instance. The hex-encoded payload is transmitted silently, allowing the attacker to decode the sensitive information from server logs.

The Role of Mermaid Diagrams

Mermaid’s flexibility, including its support for CSS and hyperlinks, makes this attack vector particularly insidious. Unlike direct prompt injection, where attackers engage in a dialogue with the AI, this method conceals commands within seemingly benign files like emails or PDFs. This stealthy approach is especially effective in phishing campaigns, as it reduces the likelihood of detection.

Discovery and Disclosure Timeline

Security researcher Adam Logue identified this vulnerability and noted similarities to a prior Mermaid exploit in Cursor IDE, which enabled zero-click exfiltration via remote images. However, the M365 Copilot exploit required user interaction.

The discovery timeline highlights challenges in coordination:

– August 15, 2025: Adam Logue reported the complete situation to the Microsoft Security Response Center (MSRC) after discussions at DEFCON.

– September 8, 2025: After iterations, including video proofs, MSRC confirmed the vulnerability.

– September 26, 2025: Microsoft resolved the issue by removing interactive hyperlinks from Copilot’s rendered Mermaid diagrams.

Despite the responsible disclosure, M365 Copilot fell outside the bounty scope, resulting in no reward for the researcher.

Implications for Enterprise Security

This incident underscores the risks associated with AI tool integrations, particularly in enterprise environments handling sensitive data. As large language models (LLMs) like Copilot connect to APIs and internal resources, defenses against indirect injections become critical.

Microsoft has emphasized ongoing mitigations to address such vulnerabilities. However, experts urge users to verify document sources and closely monitor AI outputs to prevent potential data breaches.

Conclusion

The discovery of this vulnerability in M365 Copilot highlights the evolving nature of cybersecurity threats in AI-powered tools. Organizations must remain vigilant, ensuring that integrations with AI assistants do not inadvertently expose sensitive data to malicious actors.