Skip to content
AI / LLM Write-up Intermediate

Indirect Prompt Injection - Markdown Magic

An attacker could inject markdown containing a malicious link into an LLM agent's test console, and that markdown was later rendered unsanitised on a separate monitoring endpoint, redirecting users to an attacker-controlled site. The issue is a stored indirect prompt injection that enables phishing-style social engineering.

medium.com

Published on medium.com

I have found an indirect prompt injection where the application was using markdown functionality. The application was supporting markdown in a test consolefunctionality which was a normal behavior, however the injected markdown was then being executed on the /monitor endpoint while clicking on Prompt and Response tab…

Jerry Shah (Jerry), on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application failed to sanitise markdown when generating logs, so content from the LLM agent was rendered as active markdown on the monitoring endpoint.

Impact

The stored markdown could be used for UI manipulation, misleading information, or phishing-style social engineering against authenticated users; JavaScript execution was not possible, but the issue abuses a trusted CSP domain and persists.

What the attacker needed

Access to an LLM agent-enabled account; victim clicks the rendered markdown link

The fix

The application should restrict markdown rendering to its intended context, block or strictly validate external image content based on response Content-Type (disallowing image/svg+xml), and isolate rendered content to prevent abuse of trusted analytics domains.

How it was found

  1. Log into the application and go to an endpoint where the LLM agent is available.
  2. Enter a markdown prompt containing a link to an attacker-controlled site.
  3. Submit the prompt; the markdown executes in the agent (intended behaviour).
  4. Using another user, go to the /monitor endpoint and open the conversation log under the Prompt and Response tab.
  5. Observe that the markdown is rendered in the pop-up and clicking the link redirects to the attacker's site.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A large language model (LLM) is an AI that processes text. This application let users type markdown (a simple formatting language) into a chat with the AI, which is normal. But the same markdown was later shown on a different page without being cleaned, so a link the attacker wrote could trick other users into visiting a bad website.

What is AI / LLM?

Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.

Similar reports

View all

Same bug class and techniques, clearest first.

AI and LLM vulnerabilities

The lesson behind this report.

Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.