How a 1 MB Image Caused a Denial of Service
A ticketing application processed uploaded images for thumbnails without validating their decoded size, so a roughly 1 MB image that expanded to about 1 GB consumed excessive memory and CPU. This caused legitimate requests from other clients to slow down and eventually time out, indicating an application-level denial of service.
medium.com
Published on medium.com
Bug Bounty
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.
Context
During a security assessment of a ticketing application, the researcher found that a small image could trigger excessive resource consumption on the backend. The feature involved is the attachment workflow on ticket comments: a user uploads an image and references it in a comment, and the backend processes the attachment, including generating a thumbnail.
The interesting property of the crafted file was that an image of approximately 1 MB could expand to nearly 1 GB when decompressed. When the application tried to generate a thumbnail from it, image processing became extremely expensive and eventually affected the availability of the service.

Setup
The report does not describe accounts, roles, tooling or software versions. The only precondition it makes explicit is the three-step attachment workflow the application used:
- The client requested a pre-signed upload URL.
- The image was uploaded directly to Amazon S3.
- The client submitted a comment referencing the uploaded attachment.
The relevant endpoint was:
POST /api/v1/tickets/commentHost: api.example.com
Finding it
The researcher noticed that the backend decoded the uploaded image and generated a thumbnail as part of comment submission. Because the compressed file was about 1 MB but its decompressed size was around 1 GB, decoding required significantly more resources than the file size on disk suggested. Since image processing appeared to occur during comment submission, expensive operations could interfere with normal application requests.
Exploitation
Step 1: obtain a pre-signed upload URL and upload the image
The client first requested a pre-signed upload URL, then uploaded the image directly to Amazon S3. The report does not show the request used for this step.
Step 2: submit a comment referencing the uploaded object
The client then submitted a comment referencing the uploaded attachment:
POST /api/v1/tickets/commentHost: api.example.com
The request included a reference to the uploaded object:
{ "id": "[TICKET_ID]", "body": "<p>Example comment</p>", "attachments": [ { "key": "tmp/FILE_ID/IMAGE_ID", "filename": "compressed.png" } ]}
The attachments array carries the S3 object key (tmp/FILE_ID/IMAGE_ID) and the filename compressed.png. The backend subsequently processed the attachment, including generating a thumbnail. This was where the vulnerability occurred.
Step 3: observe the response
During testing, the malicious request eventually returned:
HTTP/2 503 Service Unavailable
The response took approximately 30 seconds.
Step 4: test whether unrelated requests are affected
To determine whether the issue affected only the malicious request, the researcher tested the application using two separate clients. One submitted comments referencing the crafted image. The other submitted legitimate comments with normal images.
The legitimate client experienced the following results:
| Response time | Status |
|---|---|
| 2.4237 seconds | 200 OK |
| 14.6519 seconds | 200 OK |
| 60.8544 seconds | Read Timeout |
The results suggested that the image-processing workload could affect unrelated requests. This was the most important finding: the issue was not limited to processing the malicious attachment. It presented a potential application-level Denial of Service (DoS).
Root cause
The likely underlying problem was insufficient resource validation during image processing. Checking compressed file size alone is not enough: an image's decoded dimensions and pixel count determine its actual memory requirements. Without proper restrictions, image processing can lead to:
- Excessive memory consumption.
- CPU exhaustion.
- Blocked application workers.
- Increased response times.
- Service unavailability.
Impact
A 1 MB file triggered an expensive backend operation, causing legitimate requests to experience significant delays and timeouts. Because processing appeared to happen during comment submission, the workload could affect requests unrelated to the malicious attachment, making this a potential application-level Denial of Service.
Fix
Its recommendation is that image uploads must be validated based on their decoded characteristics, not just their size on disk. The report recommends validating uploads based on their decoded characteristics, not just their size on disk.
Variants to test
- Other image-processing entry points. Try avatars, profile pictures, ticket attachments and export features that generate thumbnails. A positive result is a small upload that produces a slow response or a 5xx from the processing service.
- Different compressed formats. Test formats whose decompressed size can greatly exceed the file size. A positive result is a large gap between upload size and processing time or memory use.
- Concurrent submissions. Submit several crafted attachments in parallel and measure latency on an unrelated client. A positive result is rising latency or timeouts on requests that do not touch the crafted files.
- Direct-to-storage upload paths. Where uploads go straight to object storage, check whether the backend re-validates the object when it is referenced. A positive result is that a file accepted by storage is processed without decoded-size checks.
What happened, in plain words
A security researcher was testing a ticketing application, the kind of website where people create support tickets and attach screenshots or other images to their comments. He found that a very small image file, about 1 MB in size, could make the server work extremely hard. When the server tried to create a small preview picture (a thumbnail) from that image, it used a huge amount of memory and processing power, close to 1 GB. That made the application slow down for other requests too, not just for the person who uploaded the image. Legitimate users started waiting many seconds, and some requests timed out completely. This is called a denial of service: the service becomes unavailable because it is overwhelmed.

The image above is the header of the original write-up, showing the title and the author.
Introduction
During a security assessment of a ticketing application, the researcher discovered that a relatively small image could trigger excessive resource consumption on the backend. The interesting part was that an image of approximately 1 MB could expand to nearly 1 GB when decompressed. When the application attempted to generate a thumbnail, image processing became extremely expensive, eventually affecting the availability of the service.
To understand this, you need to know a few basic ideas. A ticketing application is a website where users report problems or ask for help by creating tickets. Each ticket can have comments, and comments can have attachments such as images. A backend is the part of the website that runs on the server, invisible to you; it stores data, processes requests and does the heavy work. Resource consumption means how much of the server's memory, processing power (CPU) and time a task uses. Decompression is the process of unpacking a compressed file back to its original form. Many image formats, like PNG, store the image in a compressed way to save space; when the server needs to display or resize the image, it must decompress it first. A thumbnail is a small preview version of an image, often generated automatically by the server so that pages load faster.
The key point is that a file can be tiny on disk but huge when unpacked. Think of a vacuum-sealed bag of clothes: it takes little space in your suitcase, but once you open it, it fills the room. The server did not account for the size of the clothes inside, only the sealed bag.
Understanding the Attack Surface
The application used a three-step attachment workflow:
- The client requested a pre-signed upload URL.
- The image was uploaded directly to Amazon S3.
- The client submitted a comment referencing the uploaded attachment.
The relevant endpoint was:
POST /api/v1/tickets/commentHost: api.example.com
Let us break down each term. An endpoint is a specific address on the server that accepts requests, like a counter at a post office where you hand in a particular form. POST is a method used by browsers and apps to send data to a server, for example when you submit a form. /api/v1/tickets/comment is the path that identifies the comment feature. Host: api.example.com is a header that tells the server which website you are talking to; it is like writing the department name on an envelope. API stands for Application Programming Interface: a set of rules that lets one program talk to another. In a website, the front-end (what you see in the browser) uses the API to ask the backend to do things, such as save a comment.
A pre-signed upload URL is a special web address that grants temporary permission to upload a file to a storage service. It is like a one-time ticket to a locker: the server gives you the ticket, and you can put your file in the locker without needing the master key. Amazon S3 is a cloud storage service run by Amazon; many applications use it to store files because it is reliable and scalable. Uploading directly to S3 means the file goes straight from your browser to the storage service, bypassing the application server, which saves the application from handling large files.
The three steps are:
- The client (your browser or app) asks the application for permission to upload a file. The application replies with a pre-signed URL.
- The client uses that URL to upload the image directly to Amazon S3. The image is now stored in a bucket (a container for files).
- The client sends a comment to the application, including a reference to the uploaded file. The reference is like a claim ticket: it tells the application which file in S3 to attach to the comment.
The request included a reference to the uploaded object:
{ "id": "[TICKET_ID]", "body": "<p>Example comment</p>", "attachments": [ { "key": "tmp/FILE_ID/IMAGE_ID", "filename": "compressed.png" } ]}
This is a JSON object, a common way to structure data using curly braces, keys and values. Let us go through it line by line (though it is written on one line here, we can read it as if it were formatted):
"id": "[TICKET_ID]"tells the server which ticket the comment belongs to.[TICKET_ID]is a placeholder for the actual ticket number."body": "<p>Example comment</p>"is the text of the comment. The<p>and</p>are HTML tags that mark a paragraph; they are not displayed but tell the browser how to format the text."attachments": [starts a list (array) of attachments. Each attachment is an object with akeyand afilename."key": "tmp/FILE_ID/IMAGE_ID"is the identifier of the file in S3. It is like the file's address inside the storage bucket.tmplikely stands for temporary, andFILE_IDandIMAGE_IDare placeholders for unique identifiers."filename": "compressed.png"is the name of the file as it will appear to users. The.pngextension indicates the image format.
The backend subsequently processed the attachment, including generating a thumbnail. This was where the vulnerability occurred.
A vulnerability is a weakness in a system that can be exploited to cause harm. Here, the likely weakness is that the server did not properly check the image before processing it.
The Problem: Image Decompression
The uploaded image was approximately 1 MB, but its decompressed size was around 1 GB. When the backend decoded the image, it required significantly more resources than the compressed file size suggested. Because image processing appeared to occur during comment submission, expensive operations could interfere with normal application requests.
Decoding an image means converting the compressed data into a grid of pixels that the computer can display or manipulate. Each pixel takes up memory, and a large number of pixels means a lot of memory. For example, an image with dimensions 10,000 by 10,000 pixels has 100 million pixels. If each pixel uses 4 bytes (for red, green, blue and transparency), that is 400 million bytes, or about 400 MB, even if the compressed file is only a few hundred kilobytes. The researcher's image had a decompressed size of about 1 GB, which is enormous for a thumbnail operation.
During testing, the malicious request eventually returned:
HTTP/2 503 Service Unavailable
The response took approximately 30 seconds.
HTTP/2 is a version of the protocol used by browsers and servers to communicate. 503 Service Unavailable is a status code that means the server is currently unable to handle the request, often because it is overloaded or down for maintenance. The error took approximately 30 seconds to return.
Demonstrating the Impact
To determine whether the issue affected only the malicious request, the researcher tested the application using two separate clients. One submitted comments referencing the crafted image. The other submitted legitimate comments with normal images. The legitimate client experienced the following results:
| Response time | Status |
|---|---|
| 2.4237 seconds | 200 OK |
| 14.6519 seconds | 200 OK |
| 60.8544 seconds | Read Timeout |
A client here means a separate program or browser session that sends requests to the application. Using two clients simulates two different users. The first client sent comments referencing the crafted image, while the second sent normal comments. The table shows the response times and status codes for the legitimate client's requests.
- Response time is how long the client waited for the server to reply.
- 200 OK is the standard status code for a successful request.
- Read Timeout means the client gave up waiting after 60.8544 seconds because the server did not respond in time.
The results suggested that the image-processing workload could affect unrelated requests. This was the most important finding: the issue was not limited to processing the malicious attachment. It presented a potential application-level Denial of Service (DoS).
A Denial of Service attack aims to make a service unavailable to its legitimate users. Application-level means the attack targets the application itself (the software), rather than the network or infrastructure. In this case, the crafted image appeared to make the server spend so much time and memory on processing that other requests were delayed.
Root Cause
The likely underlying problem was insufficient resource validation during image processing. Checking compressed file size alone is not enough. An image's decoded dimensions and pixel count determine its actual memory requirements. Without proper restrictions, image processing can lead to:
- Excessive memory consumption.
- CPU exhaustion.
- Blocked application workers.
- Increased response times.
- Service unavailability.
Resource validation means checking that a request will not use more resources than allowed. Decoded dimensions are the width and height of the image after decompression, in pixels. Pixel count is width multiplied by height. Memory consumption is the amount of RAM used. CPU exhaustion means the processor is fully busy, leaving no capacity for other tasks. Application workers are processes or threads that handle requests; if they are blocked, new requests wait. Service unavailability is when the service cannot be used.
The report does not describe which specific validation, if any, the application performed beyond the size on disk.
Conclusion
This vulnerability demonstrates how a seemingly harmless image upload can become an availability issue. A 1 MB file triggered an expensive backend operation, causing legitimate requests to experience significant delays and timeouts. Image uploads must be validated based on their decoded characteristics, not just their size on disk.
Glossary
- API: Application Programming Interface; a set of rules that allows different software programs to communicate.
- Attachment: A file (such as an image) added to a comment or ticket.
- Backend: The server-side part of an application that processes requests and stores data.
- Client: A program or device that sends requests to a server, such as a web browser.
- CPU: Central Processing Unit; the part of a computer that executes instructions.
- Denial of Service (DoS): An attack that makes a service unavailable to legitimate users.
- Decompression: The process of expanding compressed data back to its original form.
- Decoded dimensions: The width and height of an image after decompression, measured in pixels.
- Endpoint: A specific URL or address on a server that accepts requests.
- HTTP/2: A version of the Hypertext Transfer Protocol used for communication between clients and servers.
- JSON: JavaScript Object Notation; a text format for structured data using key-value pairs.
- Memory consumption: The amount of RAM used by a program.
- Pixel count: The total number of pixels in an image, calculated as width times height.
- Pre-signed URL: A URL that grants temporary permission to upload or access a file in cloud storage.
- Resource validation: Checking that a request will not exceed allowed limits on memory, CPU, or other resources.
- Response time: The time taken for a server to respond to a request.
- S3 (Amazon Simple Storage Service): A cloud storage service provided by Amazon Web Services.
- Status code: A three-digit number in an HTTP response indicating the outcome (e.g. 200 OK, 503 Service Unavailable).
- Thumbnail: A small preview version of an image.
- Timeout: A situation where a request is abandoned because it took too long.
- Vulnerability: A weakness in a system that can be exploited to cause harm.
- Worker: A process or thread in a server application that handles requests.