Skip to content
AI / LLM Write-up Intermediate

When JPEGs Start Giving Orders: A Journey into Multi-modal Prompt Injection

An image-captioning feature using a vision-language model did not filter instructions embedded in uploaded images, so the model followed them instead of describing the picture. An attacker could make the model output chosen text and disclose internal prompt details and apparent environment information.

infosecwriteups.com

Published on infosecwriteups.com

Hello World! During a recent security assessment, I came across an interesting finding in an AI-powered application that used a vision-language model to generate captions from user-supplied images.

Jobson, on infosecwriteups.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 image-captioning module passed user-supplied images to the vision-language model without guardrails that separate image content from instructions, unlike other AI features in the app.

Impact

An attacker could control the model's output and potentially obtain internal prompt instructions, application details, and apparent environment variables, though the authenticity of some disclosed values was not verified.

What the attacker needed

Access to the image upload or URL feature

The fix

The feature should be fixed by adding guardrails and validation so that user-controlled image content is treated as untrusted input and cannot override the model's instructions.

How it was found

  1. Create an image containing written prompt injection instructions.
  2. Submit the image to the image-captioning feature.
  3. Observe that the model follows the embedded instructions instead of describing the image.
  4. Try further payloads to see whether the model discloses internal prompt or environment details.

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 vision-language model is an AI that can look at a picture and describe it in words. Here, the app let users upload pictures, and the AI read any written instructions hidden inside the picture as if they were commands. That let a user make the AI say things it was not supposed to say.

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.