News for hackers. Stuff that matters.
Re:Exploiting ACropalypse: Recovering Truncated PNGs by ericpauley on Saturday March 18, 2023 @04:34PM (#35212849)
I’m guessing most exif stripping would deserialize the image and write a new file, so unless that has the same bug as this (overwriting the existing file without truncation), it ought to work?
Re:Exploiting ACropalypse: Recovering Truncated PNGs by Retr0id on Saturday March 18, 2023 @04:41PM (#35212903)
A naive approach to stripping EXIF from a PNG would be to parse up to the start of the first eXIf chunk, discard the contents of that chunk, and then include the rest of the file verbatim without actually parsing anything.

But yes, a more sensibly coded EXIF stripper would deserialise and reserialise. Unfortunately I am no longer able to assume that programmers will behave sensibly.

Re:Exploiting ACropalypse: Recovering Truncated PNGs by ericpauley on Sunday March 19, 2023 @01:06AM (#35216216)
Does anyone take this “naive” approach in practice? Any good image sanitization I’ve seen is equivalent to taking a screenshot of the image, re-serializing pixel contents but ignoring anything else. Any reputable service (e.g., Gmail) must take this approach to prevent proliferation of possible image-based malware.

As you noted above Discord doesn’t sanitize PNGs. This exposes a failing on their end as well, as large services taking input from users should sanitize images to protect both senders and recipients.

Re:Exploiting ACropalypse: Recovering Truncated PNGs by jsheard on Saturday March 18, 2023 @04:40PM (#35212899)
Discord strips EXIF but the author was still able to unredact the images they'd posted there

Some implementations of EXIF stripping might help, but it's not guarenteed

Re:Exploiting ACropalypse: Recovering Truncated PNGs by Retr0id on Saturday March 18, 2023 @04:42PM (#35212905)
Discord doesn't strip EXIF from PNGs, only JPEGs
Re:Exploiting ACropalypse: Recovering Truncated PNGs by jsheard on Saturday March 18, 2023 @04:48PM (#35212955)
Seriously? What's the reasoning behind that?
Re:Exploiting ACropalypse: Recovering Truncated PNGs by Retr0id on Saturday March 18, 2023 @04:51PM (#35212978)
It's rare to see PNGs in-the-wild containing EXIF data, it's a feature that's only been in the spec since ~2017. I'm actually looking for one to double-check my statement about discord, but I can't find any.

Edit: I made my own. I can confirm that the exif chunk was not stripped. https://cdn.discordapp.com/attachments/541730746805649476/10...

Re:Exploiting ACropalypse: Recovering Truncated PNGs by rtldg on Monday March 20, 2023 @03:40AM (#35228433)
That's interesting. I've seen a couple of rotated PNGs before which I assumed were caused by Discord stripping the EXIF and orientation data. Found a PNG like that without EXIF from May 2022 so I wonder if Discord stopped stripping or if it was stripped on the person's device somewhere.