Skip to content
Info disclosure Write-up Advanced

Exploiting aCropalypse: Recovering Truncated PNGs

A vulnerability in Android's screenshot cropping feature caused the original image data to remain in the file after cropping, allowing recovery of the cropped-out portions. An attacker with access to a cropped screenshot could potentially recover sensitive information that was cropped out.

David Buchanan Follow

Published on da.vidbuchanan.co.uk

This article assumes you’ve already heard about the aCropalypse vulnerability, aka CVE-2023-21036. If not, go read about it here (oops, this page doesn't exist yet.

David Buchanan, on da.vidbuchanan.co.uk

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 file was opened without the truncation flag, so writing a smaller cropped image left the original data intact after the new image's end.

Impact

An attacker who obtains a cropped screenshot could recover the cropped-out portions, potentially revealing sensitive information such as addresses or other private details.

What the attacker needed

Vulnerable Android device; access to a cropped screenshot file

The fix

The vulnerability was fixed by changing the file open mode to include truncation, so that the original data is removed when saving a cropped image.

How it was found

  1. Take a screenshot on a vulnerable Android device.
  2. Crop the screenshot and save it.
  3. The saved file contains the new cropped image followed by leftover data from the original.
  4. Use a tool to parse the PNG and decompress the zlib stream starting from various bit offsets.
  5. Recover the decompressed data to view the original uncropped image.

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 you crop a screenshot on some Android phones, the phone saves the new smaller image but doesn't erase the old data that was outside the crop. This means the original full image can sometimes be reconstructed from the file, potentially revealing private information you thought you had removed.

What is Info disclosure?

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

More from Google

View all

The newest disclosed reports for this program.

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.