Skip to content
AI / LLM Write-up Advanced

Weaponizing image scaling against production AI systems

The researchers found that AI systems downscale uploaded images before sending them to the model, and this downscaling can reveal a hidden prompt injection that is not visible at full resolution. An attacker could use such an image to make the model perform actions, such as exfiltrating user data, without the user's knowledge.

blog.trailofbits.com

Published on blog.trailofbits.com

Picture this: you send a seemingly harmless image to an LLM and suddenly it exfiltrates all of your user data. By delivering a multi-modal prompt injection not visible to the user, we achieved data exfiltration on systems including the Google Gemini CLI.

The author, on blog.trailofbits.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

Multi-modal prompt injection is usually discussed as text hidden in an image: white-on-white instructions, tiny fonts, metadata. This work takes a different route. The payload is not visible at the resolution the user uploads, and in the Gemini CLI there is no preview at all, because it only comes into existence after the application has resized the image on its way to the model. By crafting pixels so that a downscaling algorithm produces text that was never legible in the original, the researchers achieved data exfiltration on production systems including the Google Gemini CLI.

Context

The targets are multi-modal AI systems that accept image uploads: the Gemini CLI, Vertex AI Studio, Gemini's web and API interfaces, Google Assistant on Android, and Genspark. In each case the feature under test is ordinary image input. The user supplies a picture, the system passes it to a model, and the model may act on what it sees, including calling tools.

The relevant behaviour is not in the model but in the plumbing around it. Large images are commonly scaled down before they reach the model, to fit token or size budgets. That resizing step is an interpolation: several high-resolution pixels are combined into one low-resolution pixel. If an attacker controls the high-resolution pixels, they can control what the low-resolution result looks like, independently of what the full-resolution image appears to show.

Image showing a side-by-side comparison of an image that is harmless at the original resolution but contains a prompt injection when scaled down
Figure 1: Ghost in the Scale: Side-by-side comparison of an image that is harmless at the original resolution but contains a prompt injection when scaled down From the original on blog.trailofbits.com

Figure 1 shows the idea side by side: an image that is harmless at its original resolution, and the prompt injection that appears once it is scaled down.

Image scaling attacks are not new. The report traces them to earlier work against computer vision systems that enforced a fixed input size, where they were used for model backdoors, evasion and poisoning. Fixed sizes are less common now, but the systems surrounding the model still impose constraints that require scaling, which keeps the primitive alive and, in the authors' view, underexposed.

Setup

The Gemini CLI scenario was set up with the default configuration of the Zapier MCP server. That default matters: it automatically approves all MCP tool calls without user confirmation, because it sets trust=True in the Gemini CLI's settings.json. The report links this to a Gemini CLI issue. This gives the attacker an important primitive: a way to have tool calls executed without a human saying yes.

No credentials, versions or account details beyond this are given. The other systems (Vertex AI with a Gemini back end, Gemini's web interface, Gemini's API via the llm CLI, Google Assistant on an Android phone, and Genspark) are production AI systems.

Finding it

The observation is a mismatch between two images that the user and the model each believe to be the same thing. The user sees the uploaded file at full resolution. The model sees a downscaled version. If those two differ in content, and not merely in sharpness, then anything the model reads from the downscaled version was never approved by the user.

The Gemini CLI makes this worse in a specific way: it offers no preview of the image, so the user cannot see the transformed, malicious image that the model processes. On Vertex AI Studio the mismatch is visible in the other direction: the front-end UI shows the high-resolution image rather than the downscaled image the model actually perceives.

Exploitation

Step 1: fingerprint the downscaling algorithm

There are three major downscaling algorithms: nearest neighbour interpolation, bilinear interpolation and bicubic interpolation. Each needs a different attack construction. On top of that, the same algorithm is implemented differently across libraries such as Pillow, PyTorch, OpenCV and TensorFlow, with varying anti-aliasing, alignment and kernel phases, plus historical bugs of their own. Those differences change the technique required.

So the first step against any target is to work out which algorithm and which implementation it uses. The researchers built a custom test suite and methodology for this. It uses images containing checkerboard patterns, concentric circles, vertical and horizontal bands, Moiré patterns and slanted edges. These provoke artefacts such as ringing, blurring, edge handling behaviour, aliasing and colour inconsistencies, which together are usually enough to identify the algorithm and implementation and therefore which crafted attack to use.

Step 2: understand why the attack is possible

The report explains the underlying effect with a ribbon. Imagine a long ribbon with an intricate but regular pattern, pulled past you while you grab samples at regular intervals. If the pattern changes quickly you must sample frequently to capture it. Sample too slowly and you miss the parts between grabs, and the pattern you reconstruct looks nothing like the original.

Your hand is the sampler. Below a certain sampling rate you cannot unambiguously reconstruct the pattern. This aliasing is a consequence of the Nyquist-Shannon sampling theorem. An image scaling attack exploits that ambiguity deliberately: specific pixels are manipulated so that a chosen pattern emerges after downscaling.

Step 3: craft the image for bicubic interpolation

Anamorpher, the open-source tool released with the research and named after anamorphosis, currently produces crafted images for all three major methods. The report walks through bicubic interpolation in detail.

Bicubic interpolation considers the 16 pixels in a 4x4 neighbourhood around each target pixel and uses cubic polynomials to compute smooth transitions between pixel values. That creates a predictable mathematical relationship. The algorithm weights the neighbourhood pixels differently, so some contribute far more to the output than others: the high-importance pixels. If those high-importance pixels have higher luma than their surroundings, the total brightness of dark areas in the output increases.

The construction therefore solves the inverse problem:

  1. Select a decoy image with large dark areas in which to hide the payload.
  2. Adjust pixels in the dark regions so that the downsampled result is pushed toward a red background, using least-squares optimisation.
  3. Leave the text areas largely unmodified so they stay black after downscaling.

The result is strong contrast between red background and black text in the downscaled image, far stronger than anything visible at full resolution. The approach is most effective on bicubic downscaling, but the report notes it also works on specific implementations of bilinear downscaling.

How Anamorpher applies this technique on OpenCV’s implementation of bicubic interpolation
Figure 5: How Anamorpher applies this technique on OpenCV’s implementation of bicubic interpolation From the original on blog.trailofbits.com

Figure 5 shows how Anamorpher applies the technique against OpenCV's implementation of bicubic interpolation.

Anamorpher exposes this through a front-end interface and a Python API for visualising and crafting attacks against specific algorithms and implementations, and it has a modular back end so users can plug in their own downscaling algorithm. It is in beta.

Step 4: exfiltrate data through the Gemini CLI

With the Zapier MCP server configured as described, the attack runs as follows:

  1. The user uploads a seemingly benign image to the CLI.
  2. No preview is available, so the user cannot see the transformed, malicious image the model processes.
  3. The image and its embedded prompt injection trigger actions from Zapier.
  4. Zapier exfiltrates user data stored in Google Calendar to an attacker's email, without confirmation.

Figure 2 is a video of this attack. The chain depends on two conditions holding together: the scaling step that materialises the payload, and the MCP configuration that removes the confirmation prompt before the tool call.

Step 5: repeat on other systems

The same class of attack was demonstrated successfully on:

  • Vertex AI with a Gemini back end
  • Gemini's web interface
  • Gemini's API via the llm CLI
  • Google Assistant on an Android phone
  • Genspark

Figures 3 and 4 show the same persistent mismatch between what the user perceives and what the model receives on Genspark and Vertex AI Studio respectively. Vertex AI Studio is called out as particularly impactful because its front-end shows the high-resolution image rather than the downscaled one the model sees. The researchers state that the vector is widespread and extends well beyond the systems documented.

Root cause

The flaw is architectural rather than a single coding mistake. The system presents one image to the human and a different image to the model, and nothing reconciles the two. Downscaling is a lossy, content-changing transformation when the input is adversarial, and the pipeline treats it as a harmless size reduction.

There is no preview of the model's actual input in the CLI or API tools, and where a UI exists it may show the original. Tool-call confirmation, the natural control point for prompt injection, was disabled by the MCP server's default trust=True setting.

Impact

On the Gemini CLI, the demonstrated impact is exfiltration of user data stored in Google Calendar to an attacker-controlled email address, performed through Zapier tool calls without user confirmation. More generally, an attacker who can get a crafted image in front of a multi-modal agent can have text of their choosing interpreted as instructions by the model, while the user sees only a benign picture. Where the agent has tool access and confirmations are absent or bypassable, that text can drive sensitive actions.

The impact depends on conditions: the target must downscale images, the attacker must know or fingerprint the algorithm and implementation, and the agent must have reachable tools whose calls are not gated by explicit confirmation. The report frames the results as one of many prompt injection attacks already demonstrated on agentic coding tools, alongside prior work achieving data exfiltration and remote code execution through unsafe sandbox actions, overly permissive network allowlists and environment configuration changes, and concludes that these tools still lack sufficiently secure defaults, design patterns and systematic defences.

Fix

The report's recommendations, in order of strength:

  1. Do not downscale images at all; simply limit the upload dimensions instead.
  2. For any transformation, and especially if downscaling is necessary, always show the end user a preview of the input the model is actually seeing, including in CLI and API tools.
  3. Implement secure design patterns and systematic defences against impactful prompt injection generally. In particular, inputs, and above all text within an image, should not be able to initiate sensitive tool calls without explicit user confirmation.

Picking the least vulnerable downscaling algorithm is explicitly rejected as a robust approach, especially since the attacks are not limited to the three algorithms discussed.

Variants to test

  • Mobile and edge devices. Fixed image sizes are enforced more often there, and suboptimal downscaling algorithms ship in default frameworks and tools. The report flags mobile and edge devices, where fixed image sizes are enforced more often and suboptimal downscaling algorithms ship in default frameworks and tools, as future work.
  • Voice AI. The report flags the additional attack surface introduced by voice AI as future work. The report flags the additional attack surface introduced by voice AI as future work.
  • Better fingerprinting. More effective ways of identifying the algorithm and implementation would widen the set of targets. The report suggests exploring more effective fingerprinting approaches.
  • Semantic prompt injection. Instructions that carry meaning without an obvious payload string. The report lists semantic prompt injection as a direction worth exploring.
  • Factorised diffusion. Listed as a direction worth exploring for generating adversarial inputs.
  • Polyglots. Files that are valid in more than one format, chained with the scaling trick.
  • Other artefacts, especially those chained with upscaling, such as dithering. The report suggests exploring additional artefact exploitation, especially any typically chained with upscaling, such as dithering.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 18 min read.

What happened, in plain words

Imagine you hand a friend a piece of paper covered in a faint, harmless doodle. Your friend takes it into another room, holds it under a special lamp, and suddenly the doodle turns into a set of written instructions. Your friend follows those instructions, and your private diary ends up in someone else's hands. You never saw the instructions, because they only appeared under that lamp.

That is roughly what the researchers in this work did to a set of real AI products. They uploaded pictures that looked innocent at the size you and I would see them. But before an AI model looks at a picture, the software around the model often shrinks it down to save space and computing effort. When these particular pictures were shrunk, hidden text appeared inside them. The AI model read that text as if it were an instruction from the user, and in one demonstration it sent a user's calendar data to an attacker's email address.

The technique is called a multi-modal prompt injection. Let us unpack that phrase, because it is the heart of everything below.

  • Prompt: the instruction or question you give an AI model. When you type "summarise this email", that is a prompt.
  • Injection: sneaking your own instruction into a place the system did not expect instructions to come from, so the model treats it as legitimate. It is like writing "ignore the recipe, order pizza" in the margin of a cookbook page someone is reading aloud.
  • Multi-modal: the model accepts more than one kind of input, for example text and images together. A multi-modal prompt injection hides the instruction in a non-text input, here an image.

Normally, people hide text in an image in ways a human could spot if they looked closely: white text on a white background, tiny fonts, or notes tucked into the file's metadata (the hidden descriptive fields that files carry). This work takes a different route. The hidden instruction is not visible at the resolution the user uploads, and in the Gemini CLI there is no preview at all, because it only comes into existence after the application has resized the image on its way to the model. By crafting individual pixels so that the shrinking process produces text that was never legible in the original, the researchers achieved data exfiltration (getting private data out of a system and into the attacker's hands) on production systems, including the Google Gemini CLI.

Image showing a side-by-side comparison of an image that is harmless at the original resolution but contains a prompt injection when scaled down
Figure 1: Ghost in the Scale: Side-by-side comparison of an image that is harmless at the original resolution but contains a prompt injection when scaled down From the original on blog.trailofbits.com

Figure 1 shows the idea side by side: an image that is harmless at its original resolution, and the prompt injection that appears once it is scaled down.

Context

To follow the rest, you need a rough picture of the products involved. None of these are obscure; they are ordinary tools people use every day.

  • Gemini is Google's family of AI models. A model is the trained program that reads your input and produces an answer.
  • Gemini CLI is a command-line interface for Gemini. A command-line interface (CLI) is a program you operate by typing text commands into a terminal window, rather than clicking buttons. Developers like it because it is fast and scriptable.
  • Vertex AI Studio is Google's web-based workbench for building and testing AI applications. You open it in a browser.
  • Gemini's web interface is the ordinary chat page in a browser.
  • Gemini's API is the way other programs talk to Gemini directly. An API (application programming interface) is a fixed set of rules for one program to request things from another, like a restaurant menu: you order by name, and you get a predictable dish back. The report mentions reaching the API through a tool called the llm CLI.
  • Google Assistant is the voice assistant on Android phones.
  • Genspark is another AI product that accepts images.

In each case the feature under test is ordinary image input. The user supplies a picture, the system passes it to a model, and the model may act on what it sees, including calling tools. A tool here means an action the AI can take beyond talking: reading a calendar, sending an email, running a command. When an AI can take actions, it is often called an agent.

The relevant behaviour is not in the model but in the plumbing around it. Large images are commonly scaled down before they reach the model, to fit token or size budgets. A token is a small chunk of data the model processes; providers charge and limit by tokens, and images consume a lot of them, so shrinking images saves money and keeps requests within limits.

That resizing step is an interpolation: several high-resolution pixels are combined into one low-resolution pixel. A pixel is one tiny dot of colour in an image; resolution is how many dots there are across and down. Interpolation means estimating a value between known values, the way you might guess the temperature at noon by averaging the readings at 11am and 1pm. If an attacker controls the high-resolution pixels, they can control what the low-resolution result looks like, independently of what the full-resolution image appears to show.

Image scaling attacks are not new. The report traces them to earlier work against computer vision systems that enforced a fixed input size, where they were used for model backdoors, evasion and poisoning. In plain terms:

  • A backdoor is a hidden behaviour deliberately planted in a model, triggered by a specific input.
  • Evasion means getting a system to misclassify or ignore something it should catch.
  • Poisoning means corrupting the data a model learns from so it behaves badly later.

Fixed sizes are less common now, but the systems surrounding the model still impose constraints that require scaling, which keeps the primitive alive. A primitive in security is a small, reliable capability an attacker can build on, like a single lockpick that opens many doors. The authors consider this one underexposed, meaning not widely discussed.

Setup

The Gemini CLI scenario was set up with the default configuration of the Zapier MCP server. Two terms to unpack:

  • Zapier is a service that connects apps together, so an action in one app can trigger an action in another (for example, "when this happens, send that email").
  • MCP (Model Context Protocol) is a standard way for AI tools to plug into external services. An MCP server is the piece that exposes those services to the AI.

That default matters: it automatically approves all MCP tool calls without user confirmation, because it sets trust=True in the Gemini CLI's settings.json. The report links this to a Gemini CLI issue. This gives the attacker an important primitive: a way to have tool calls executed without a human saying yes.

In other words, the safety catch that would normally ask "are you sure you want to send this email?" was switched off by a default setting. The attacker did not have to break that catch; it was already open.

No credentials, versions or account details beyond this are given. The other systems (Vertex AI with a Gemini back end, Gemini's web interface, Gemini's API via the llm CLI, Google Assistant on an Android phone, and Genspark) are production AI systems.

Finding it

The observation is a mismatch between two images that the user and the model each believe to be the same thing. The user sees the uploaded file at full resolution. The model sees a downscaled version. If those two differ in content, and not merely in sharpness, then anything the model reads from the downscaled version was never approved by the user.

Think of it like a contract where the copy you sign and the copy the other side keeps are printed at different sizes, and one of them contains a clause the other does not. Both parties think they agreed to the same thing.

The Gemini CLI makes this worse in a specific way: it offers no preview of the image, so the user cannot see the transformed, malicious image that the model processes. On Vertex AI Studio the mismatch is visible in the other direction: the front-end UI shows the high-resolution image rather than the downscaled image the model actually perceives. The front-end UI is the part of the software you see and click on in the browser.

Exploitation

Step 1: fingerprint the downscaling algorithm

There are three major downscaling algorithms: nearest neighbour interpolation, bilinear interpolation and bicubic interpolation. Each needs a different attack construction. On top of that, the same algorithm is implemented differently across libraries such as Pillow, PyTorch, OpenCV and TensorFlow, with varying anti-aliasing, alignment and kernel phases, plus historical bugs of their own. Those differences change the technique required.

Let us define these slowly, because they are the technical core.

  • Nearest neighbour interpolation: to make one new pixel, just copy the colour of the closest original pixel. It is the crudest method, like shrinking a photo by throwing away most of the dots and keeping the nearest one.
  • Bilinear interpolation: to make one new pixel, take a weighted average of the four nearest original pixels. Smoother than nearest neighbour.
  • Bicubic interpolation: to make one new pixel, take a weighted average of the sixteen nearest original pixels (a 4x4 block), using a cubic curve to blend them. Smoother still.
  • A library is a collection of ready-made code that programmers reuse instead of writing everything from scratch. Pillow, PyTorch, OpenCV and TensorFlow are popular libraries that handle images and machine learning.
  • Anti-aliasing is a smoothing step that reduces jagged edges.
  • Alignment and kernel phase refer to exactly where the sampling grid sits relative to the original pixels; small shifts change the output.

So the first step against any target is to work out which algorithm and which implementation it uses. This is called fingerprinting: identifying a system from its distinctive behaviour, the way you might recognise a friend's handwriting without seeing their name.

The researchers built a custom test suite and methodology for this. It uses images containing checkerboard patterns, concentric circles, vertical and horizontal bands, Moiré patterns and slanted edges. A Moiré pattern is the wavy interference pattern you sometimes see when two fine grids overlap, such as a striped shirt on a low-resolution screen. These images provoke artefacts, which are visible errors introduced by processing, such as:

  • ringing: faint echoes or halos near sharp edges;
  • blurring: loss of detail;
  • edge handling behaviour: how the algorithm treats the border of the image;
  • aliasing: false patterns created when detail is sampled too coarsely;
  • colour inconsistencies: shifts in hue or brightness.

Together these are usually enough to identify the algorithm and implementation and therefore which crafted attack to use.

Step 2: understand why the attack is possible

The report explains the underlying effect with a ribbon. Imagine a long ribbon with an intricate but regular pattern, pulled past you while you grab samples at regular intervals. If the pattern changes quickly you must sample frequently to capture it. Sample too slowly and you miss the parts between grabs, and the pattern you reconstruct looks nothing like the original.

Your hand is the sampler. Below a certain sampling rate you cannot unambiguously reconstruct the pattern. This aliasing is a consequence of the Nyquist-Shannon sampling theorem, which says, in everyday terms, that to faithfully capture a signal you must sample it at least twice as fast as its fastest change. Sample slower and you get a convincing but wrong picture. An image scaling attack exploits that ambiguity deliberately: specific pixels are manipulated so that a chosen pattern emerges after downscaling.

Step 3: craft the image for bicubic interpolation

Anamorpher, the open-source tool released with the research and named after anamorphosis (a picture that looks like one thing from one angle and something else from another, like the distorted skull in Holbein's painting The Ambassadors), currently produces crafted images for all three major methods. Open source means the code is published for anyone to read and reuse. The report walks through bicubic interpolation in detail.

Bicubic interpolation considers the 16 pixels in a 4x4 neighbourhood around each target pixel and uses cubic polynomials to compute smooth transitions between pixel values. A polynomial is a simple mathematical expression like a curve; a cubic one has a term raised to the third power. That creates a predictable mathematical relationship. The algorithm weights the neighbourhood pixels differently, so some contribute far more to the output than others: the high-importance pixels. If those high-importance pixels have higher luma (brightness) than their surroundings, the total brightness of dark areas in the output increases.

The construction therefore solves the inverse problem: instead of asking "what does this image look like after shrinking?", it asks "what original image would shrink into the picture I want?". It is like working backwards from a cake to the exact ingredients and oven settings that would produce it.

  1. Select a decoy image with large dark areas in which to hide the payload. A decoy is the harmless-looking front.
  2. Adjust pixels in the dark regions so that the downsampled result is pushed toward a red background, using least-squares optimisation. That is a standard mathematical method for finding the settings that get closest to a desired result, minimising the total squared error.
  3. Leave the text areas largely unmodified so they stay black after downscaling.

The result is strong contrast between red background and black text in the downscaled image, far stronger than anything visible at full resolution. The approach is most effective on bicubic downscaling, but the report notes it also works on specific implementations of bilinear downscaling.

How Anamorpher applies this technique on OpenCV’s implementation of bicubic interpolation
Figure 5: How Anamorpher applies this technique on OpenCV’s implementation of bicubic interpolation From the original on blog.trailofbits.com

Figure 5 shows how Anamorpher applies the technique against OpenCV's implementation of bicubic interpolation.

Anamorpher exposes this through a front-end interface and a Python API for visualising and crafting attacks against specific algorithms and implementations, and it has a modular back end so users can plug in their own downscaling algorithm. Python is a popular programming language. Modular means built from interchangeable parts, so you can swap one piece without rebuilding the whole. It is in beta, meaning it works but is still under active development.

Step 4: exfiltrate data through the Gemini CLI

With the Zapier MCP server configured as described, the attack runs as follows:

  1. The user uploads a seemingly benign image to the CLI.
  2. No preview is available, so the user cannot see the transformed, malicious image the model processes.
  3. The image and its embedded prompt injection trigger actions from Zapier.
  4. Zapier exfiltrates user data stored in Google Calendar to an attacker's email, without confirmation.

Figure 2 is a video of this attack. The chain depends on two conditions holding together: the scaling step that materialises the payload, and the MCP configuration that removes the confirmation prompt before the tool call. Remove either link and the chain breaks.

Step 5: repeat on other systems

The same class of attack was demonstrated successfully on:

  • Vertex AI with a Gemini back end
  • Gemini's web interface
  • Gemini's API via the llm CLI
  • Google Assistant on an Android phone
  • Genspark

Figures 3 and 4 show the same persistent mismatch between what the user perceives and what the model receives on Genspark and Vertex AI Studio respectively. Vertex AI Studio is called out as particularly impactful because its front-end shows the high-resolution image rather than the downscaled one the model sees. The researchers state that the vector is widespread and extends well beyond the systems documented. A vector here means a route by which an attack reaches its target.

Root cause

The flaw is architectural rather than a single coding mistake. Architecture means the overall design and how the parts fit together, as opposed to one line of code being wrong. The system presents one image to the human and a different image to the model, and nothing reconciles the two. Downscaling is a lossy, content-changing transformation when the input is adversarial, and the pipeline treats it as a harmless size reduction. Lossy means information is thrown away; adversarial means deliberately crafted to cause harm.

There is no preview of the model's actual input in the CLI or API tools, and where a UI exists it may show the original. Tool-call confirmation, the natural control point for prompt injection, was disabled by the MCP server's default trust=True setting.

Impact

On the Gemini CLI, the demonstrated impact is exfiltration of user data stored in Google Calendar to an attacker-controlled email address, performed through Zapier tool calls without user confirmation. More generally, an attacker who can get a crafted image in front of a multi-modal agent can have text of their choosing interpreted as instructions by the model, while the user sees only a benign picture. Where the agent has tool access and confirmations are absent or bypassable, that text can drive sensitive actions.

The impact depends on conditions: the target must downscale images, the attacker must know or fingerprint the algorithm and implementation, and the agent must have reachable tools whose calls are not gated by explicit confirmation. The report frames the results as one of many prompt injection attacks already demonstrated on agentic coding tools, alongside prior work achieving data exfiltration and remote code execution (running the attacker's commands on someone else's machine) through unsafe sandbox actions, overly permissive network allowlists and environment configuration changes, and concludes that these tools still lack sufficiently secure defaults, design patterns and systematic defences. A sandbox is an isolated space where code runs so it cannot harm the rest of the system; an allowlist is a list of things explicitly permitted.

Fix

The report's recommendations, in order of strength:

  1. Do not downscale images at all; simply limit the upload dimensions instead.
  2. For any transformation, and especially if downscaling is necessary, always show the end user a preview of the input the model is actually seeing, including in CLI and API tools.
  3. Implement secure design patterns and systematic defences against impactful prompt injection generally. In particular, inputs, and above all text within an image, should not be able to initiate sensitive tool calls without explicit user confirmation.

Picking the least vulnerable downscaling algorithm is explicitly rejected as a robust approach, especially since the attacks are not limited to the three algorithms discussed.

Variants to test

  • Mobile and edge devices. Fixed image sizes are enforced more often there, and suboptimal downscaling algorithms ship in default frameworks and tools. The report flags mobile and edge devices, where fixed image sizes are enforced more often and suboptimal downscaling algorithms ship in default frameworks and tools, as future work. Edge devices are phones, tablets and other gadgets at the edge of a network rather than in a data centre.
  • Voice AI. The report flags the additional attack surface introduced by voice AI as future work. Attack surface is the total set of places an attacker could try to get in. The report flags the additional attack surface introduced by voice AI as future work.
  • Better fingerprinting. More effective ways of identifying the algorithm and implementation would widen the set of targets. The report suggests exploring more effective fingerprinting approaches.
  • Semantic prompt injection. Instructions that carry meaning without an obvious payload string. Semantic means relating to meaning rather than exact wording. The report lists semantic prompt injection as a direction worth exploring.
  • Factorised diffusion. Listed as a direction worth exploring for generating adversarial inputs. Diffusion is a family of AI image-generation methods; factorised refers to splitting the process into parts.
  • Polyglots. Files that are valid in more than one format, chained with the scaling trick. A polyglot file might be a valid image and a valid script at the same time, so different programs read different things from it.
  • Other artefacts, especially those chained with upscaling, such as dithering. The report suggests exploring additional artefact exploitation, especially any typically chained with upscaling, such as dithering. Upscaling is enlarging an image; dithering is adding a fine pattern of dots to simulate colours or smooth gradients.

Glossary

  • Agent: an AI system that can take actions through tools, not just produce text.
  • Aliasing: false patterns created when a signal is sampled too coarsely to capture its detail.
  • Anamorphosis: an image that looks like one thing from one angle and something else from another.
  • Anti-aliasing: a smoothing step that reduces jagged edges when resizing.
  • API: a fixed set of rules that lets one program request things from another.
  • Artefact: a visible error introduced by processing, such as ringing or blurring.
  • Attack surface: the total set of places an attacker could try to get in.
  • Backdoor: a hidden behaviour planted in a model, triggered by a specific input.
  • Beta: software that works but is still under active development.
  • Bicubic interpolation: resizing by averaging the 16 nearest pixels with a cubic curve.
  • Bilinear interpolation: resizing by averaging the four nearest pixels.
  • CLI (command-line interface): a program operated by typing text commands in a terminal.
  • Data exfiltration: getting private data out of a system and into an attacker's hands.
  • Decoy: a harmless-looking front used to hide a payload.
  • Dithering: adding a fine pattern of dots to simulate colours or smooth gradients.
  • Edge device: a phone, tablet or other gadget at the edge of a network rather than in a data centre.
  • Evasion: getting a system to misclassify or ignore something it should catch.
  • Fingerprinting: identifying a system from its distinctive behaviour.
  • Front-end UI: the part of the software you see and click on in the browser.
  • High-importance pixel: a pixel that the resizing algorithm weights heavily in the output.
  • Injection: sneaking an instruction into a place the system did not expect instructions from.
  • Interpolation: estimating values between known values, here combining pixels when resizing.
  • Inverse problem: working backwards from a desired result to the inputs that produce it.
  • Least-squares optimisation: a mathematical method for getting as close as possible to a desired result by minimising total squared error.
  • Library: a collection of ready-made code that programmers reuse.
  • Lossy: a transformation that throws information away.
  • Luma: brightness.
  • MCP (Model Context Protocol): a standard way for AI tools to plug into external services.
  • Moiré pattern: a wavy interference pattern created when two fine grids overlap.
  • Multi-modal: accepting more than one kind of input, such as text and images.
  • Nearest neighbour interpolation: resizing by copying the colour of the closest original pixel.
  • Nyquist-Shannon sampling theorem: to faithfully capture a signal you must sample it at least twice as fast as its fastest change.
  • Open source: code published for anyone to read and reuse.
  • Pixel: one tiny dot of colour in an image.
  • Poisoning: corrupting the data a model learns from so it behaves badly later.
  • Polynomial: a simple mathematical expression such as a curve.
  • Primitive: a small, reliable capability an attacker can build on.
  • Prompt injection: sneaking an instruction into input so the model treats it as legitimate.
  • Python: a popular programming language.
  • Remote code execution: running the attacker's commands on someone else's machine.
  • Resolution: how many pixels an image has across and down.
  • Ringing: faint echoes or halos near sharp edges after processing.
  • Sandbox: an isolated space where code runs so it cannot harm the rest of the system.
  • Semantic: relating to meaning rather than exact wording.
  • Token: a small chunk of data the model processes; providers charge and limit by tokens.
  • Tool: an action an AI can take beyond talking, such as reading a calendar or sending email.
  • Upscaling: enlarging an image.
  • Vector: a route by which an attack reaches its target.

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.