All vulnerabilities
HIGHAI/LLMexploited in the wild

AI-CHATGPT-MARKDOWN-EXFIL-2023

ChatGPT · ChatGPT Markdown image exfiltration

Summary

Johann Rehberger showed that ChatGPT auto-renders Markdown image syntax, so an indirect prompt injection from a retrieved web page or document can instruct the model to URL-encode prior conversation data and embed it as a query parameter in an image URL pointing to an attacker server. Merely rendering the image silently exfiltrates the data, and the same trick can chain plugins in what he called Cross Plugin Request Forgery. He reported it to OpenAI in April 2023; a 2024 follow-up named SpAIware reused the same channel plus ChatGPT's Memory feature to achieve persistent exfiltration on the macOS app, later fixed with a url_safe API check.

How to avoid it in your code

  • Disable or sandbox auto-rendering of Markdown images from model output.
  • Treat retrieved pages/documents as untrusted data, not instructions.
  • Sanitize/encode model output and validate image URLs against an allow-list (e.g. url_safe checks).
  • Restrict egress so encoded conversation data cannot reach attacker servers.
  • Gate plugin/tool chaining behind approval to prevent cross-plugin request forgery.

References

Related vulnerabilities

All AI/LLM →