Skip to content
Info disclosure Write-up Advanced

Estimating impact

A corrupted PNG file with an invalid zlib window size caused libvips to leak uninitialized memory into generated thumbnails, allowing cross-session disclosure of image data from other users. An attacker could upload such a file to read fragments of other users' uploaded images.

blog.silentsignal.eu

Published on blog.silentsignal.eu

During a recent engagement we encountered a quite common web application feature: profile image uploads. One of the tools we used for the tests was the UploadScanner Burp Suite extension, that reported no vulnerabilities.

The author, on blog.silentsignal.eu

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 library allocated memory for bitmap buffers without zeroing it, and a malformed PNG caused it to use uninitialized memory when decoding.

Impact

An attacker could potentially read fragments of other users' uploaded images from shared process memory, though the leak was partial and required many attempts.

What the attacker needed

Ability to upload images; image processing with libvips; shared process memory across sessions

The fix

The library was fixed by switching to zero-initializing memory allocation functions, and Sharp added a defence-in-depth measure to halt processing on corrupt data.

How it was found

  1. Upload a control image as the profile picture for one test user.
  2. Upload a corrupted PNG test image as the profile picture for another test user.
  3. Download the generated thumbnail for the corrupted image and observe parts of the control image appearing.

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.

When a program creates a new image, it sometimes reuses memory that still holds old data from other users. If the program does not clear that memory first, parts of other people's pictures can appear in your new image. Here, a specially crafted PNG file tricked the image library into showing that leftover memory.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.