Memory Corruption via Large Pixels
The report claims that by modifying an image's dimensions to a very large value, the service attempts to allocate an excessive amount of memory during conversion, potentially causing memory corruption. The attacker could upload such an image to trigger backend processing issues.
- Triaged in 22 hours
- Fixed in 16 months
- Disclosed after 6.3 years
I would like to report a memory corruption issue.
#PoC: The exploit is really simple. I have an image of 5kb, 260x260 pixels. In the image itself I exchange the 260x260 values with 0xfafa x 0xfafa (so 64250x64250 pixels). Now from what I remember your service tries to convert the image once uploaded. By loading the 'whole image' into memory, it tries to allocate 4128062500 pixels into memory. which may cause some backend processing memory corruption issues.
Please have a look on attached video.
#Fix: Proper resolution checks on image uploads.
Regards, Mr.R3boot.
Attachments
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the service does not validate image dimensions before allocating memory for conversion.
Impact
The service may experience memory corruption issues during backend processing.
What the attacker needed
Ability to upload an image
How it was found
- Create a small image file with dimensions 260x260 pixels.
- Modify the image's dimension values to 64250x64250 pixels.
- Upload the modified image to the service.
- The service attempts to allocate memory for the large dimensions, potentially causing memory corruption.
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 report has not been written yet. The Original tab links to the source.
When you upload an image, the server often reads its dimensions to process it. If those dimensions are huge, the server may try to reserve a massive amount of memory, which can crash or corrupt the program. This report suggests that an attacker can change the image's size values to cause that problem.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.