This reminds me of the early binary DOC file format that was essentially a dump of Word's working memory. You could find all sorts of leaked data in the slack space between text chunks. Sometimes from other processes since `malloc` doesn't zero memory. I think there were a few instances of people being caught doing bad things because of identifying information in a Word DOC.
But why is this even happening? The standard procedure to overwrite a file is to save to a temporary file first so an error that occurs during the write won't damage the existing file. Are they really doing an in-place write and how does that affect the shadow copy if you wanted to restore the previous version of the file?
The old .doc format was never "a dump of Word's working memory", implying copy of raw bytes. It's rather Word's internal object graph serialized into COM Structured Storage (https://en.wikipedia.org/wiki/COM_Structured_Storage), which is basically a FAT-like filesystem inside a single file. This is convenient for the app because it gets an FS-like API and can serialize data into as many "files" as is convenient, and dynamically update data inside without overwriting the entire container file every time (which, back when this all was designed in late 80s - early 90s, would be slow).
Thus the reason why you could end up with old bits of a Word document sticking around inside the .doc is the same as to why your FS has bits of deleted files: the space has been marked as free, and nothing else overwrote it yet.
But none of this applies to images, so the explanation here ought to be different.
It feels like a lot of "things everyone knows" are slowly getting lost over time, as developers work at higher and higher levels of abstraction without deep knowledge of the layers beneath them (which is of course the whole point of abstractions, but they're never perfect)
Being a true "full stack" engineer is a superpower when it comes to performance optimisation, or vulnerability research.
So, Acropalypse is “people use image snipping and markup tools to redact images, but those tools often allow the unredacted images to be recovered”? Yeah, that’s a pretty big violation of the implicit expectations of users.
To be more specific "acropalypse" refers to any image editor which does not truncate the original file before overwriting it with the edited version, leading to portions of the original being recoverable by an adversary.
It originally referred to a specific vulnerability in the Markup app found on Google Pixel devices (CVE-2023-21036), but apparently now includes other unrelated apps.
This is beyond scary. I have no idea how my screenshots I took and cropped with Snipping Tool and send to someone: at work, at home, across multiple machines and accounts.
My stubbornness to relearn and move away from “printscreen+winkey+r+mspaint+enter+select+Ctenophora+c” pays off. I don’t know what it is about snipping tools (and I use sharex too” but I always find myself going back to paint, as the tools feel like they get in the way.
(As a non web-dev, maybe, )I don't think I've cared about the file size of cropped images in the past couple years. When I crop stuff it's because I want to send it to someone, not because I'm gonna archive it or anything.
For android it was a backwards incompatible, undocumented API change [0]. For windows it just looks like the UWP API is complicated enough that you can footgun yourself. For ex OpenAsync+DataWriter would do it as the default behavior [1].
Snipping Tool used to have this "feature" whereby any drawing performed on a screenshot would be animated as an overlay (this was only visible in the UWP Photos app at the time). Funnily enough, that's the first thing that came to mind when I heard of Acropalypse.
You need to take a screenshot, save it, crop it and then resave over the same file.
I mean it's bad, but... who does that?
EDIT: It also happens if you take a completely different screenshot and just save over (overwrite) another (bigger) image. That's worse, but still not that common IMHO.
It is extremely common for me to realize I don't like the screenshot I took, and to save the replacement over the original file. It is pretty common for me to be more selective about what is in the replacement, and hence for it to be smaller than the original triggering this bug.
It's a relatively uncommon scenario, granted, but when you multiply those odds by the number of screenshots that get shared on a daily basis, it's pretty bad imho.
This would have been avoided if the PNG format (or at least one commonly used editor) required that the data filled the whole file, or rendered extra junk when there was extra data at the end.
Is Mac's Preview app susceptible to this bug too? Right now it seems only confirmed for Pixel phones and Windows Snipping Tool, but I use Preview and I haven't seen anyone confirm or deny it for that one.
You should notice that the file size didn't actually get any smaller after you cropped it. The full-size image file is not truncated before the cropped version is written. The left-behind data can be recovered.
Got sent a few .PSDs (Photoshop format) and there was some artifacts which looked like they weren't intended for the recipient. Of course, this is part of the .PSD format and not a privacy issue per se. Just be careful sending .PSDs in an e-mail with stuff in them you don't want the recipient to see.
Photoshop has a checkbox to "delete cropped pixels", if unchecked using the crop tool again will show the entire original image. It also stores an undo history, so even with "delete cropped pixels" you can just undo the crop.
Like he says on Twitter - was this deliberate? Doesn't seem like it yet, and there's no proof of it, but it's pretty scary. There's excellent plausible deniability, and the law enforcement benefits could be substantial.
I was just about to ask, "Is this still coincidence, or have we jumped straight to enemy action?"
That two different tools fail in the same, "surface level invisible" but mighty convenient, and "Whoopsie, file operations are hard!" way... raises some interesting questions.
Mostly, "What else of this nature is present in all our modern operating systems?" Because this sort of failure sure looks an awful lot like the "Underhanded C" contest from 2008: http://www.underhanded-c.org/_page_id_17.html Redact an image, while leaking a lot of information in the process to someone who "knows the trick."
> This is an excellent example of the contest’s philosophy: make the code extremely simple, innocent, obvious, and wrong.
[+] [-] whoopdedo|3 years ago|reply
But why is this even happening? The standard procedure to overwrite a file is to save to a temporary file first so an error that occurs during the write won't damage the existing file. Are they really doing an in-place write and how does that affect the shadow copy if you wanted to restore the previous version of the file?
[+] [-] int_19h|3 years ago|reply
Thus the reason why you could end up with old bits of a Word document sticking around inside the .doc is the same as to why your FS has bits of deleted files: the space has been marked as free, and nothing else overwrote it yet.
But none of this applies to images, so the explanation here ought to be different.
[+] [-] Retr0id|3 years ago|reply
Being a true "full stack" engineer is a superpower when it comes to performance optimisation, or vulnerability research.
[+] [-] iggldiggl|3 years ago|reply
… which on the other hand has the annoying side effect of wrecking hard links.
[+] [-] thrashh|3 years ago|reply
I don’t think writing to a separate file is standard procedure at all. Way more apps don’t do that than do from my anecdotal memories.
[+] [-] david2ndaccount|3 years ago|reply
[+] [-] fwlr|3 years ago|reply
[+] [-] Retr0id|3 years ago|reply
It originally referred to a specific vulnerability in the Markup app found on Google Pixel devices (CVE-2023-21036), but apparently now includes other unrelated apps.
Source: It was me who came up with the name :)
[+] [-] Retr0id|3 years ago|reply
I'll have a windows-compatible PoC up at some point, might wait a little bit just to mitigate the 0day-ness heh
[+] [-] nashashmi|3 years ago|reply
Edit: tried this with snip and sketch. Also tried it with snipping tool. Fwiw, the latter results in a smaller file size.
[+] [-] dang|3 years ago|reply
Exploiting aCropalypse: Recovering truncated PNGs - https://news.ycombinator.com/item?id=35208721 - March 2023 (71 comments)
Acropalypse: a vulnerability in Google's screenshot editing tool - https://news.ycombinator.com/item?id=35207787 - March 2023 (44 comments)
[+] [-] kdrag0n|3 years ago|reply
[1] https://www.libpng.org/pub/png/apps/pngcheck.html, available in Homebrew
[+] [-] world2vec|3 years ago|reply
[+] [-] easrng|3 years ago|reply
[+] [-] basch|3 years ago|reply
[+] [-] gsich|3 years ago|reply
[+] [-] pdntspa|3 years ago|reply
Man if I ran Windows 11 to think I might be the one who stumbled on this 0-day first....
[+] [-] malka|3 years ago|reply
[+] [-] rs999gti|3 years ago|reply
Most people are not super techie computer users.
[+] [-] escapecharacter|3 years ago|reply
[+] [-] ben0x539|3 years ago|reply
[+] [-] kuroguro|3 years ago|reply
[0] https://issuetracker.google.com/issues/180526528
[1] https://stackoverflow.com/questions/35842374/how-can-i-overw...
[+] [-] xign|3 years ago|reply
[+] [-] windows2020|3 years ago|reply
New iterations of classic Snipping Tool require more clicks and the implementation is worse too.
[+] [-] marak830|3 years ago|reply
Their image tool that we were using for video snippet is a lot worse. Hell right click context menu requires more work.
Don't get me started on minimum window sizes for some default apps.
[+] [-] lazerl0rd|3 years ago|reply
[+] [-] alex7734|3 years ago|reply
I mean it's bad, but... who does that?
EDIT: It also happens if you take a completely different screenshot and just save over (overwrite) another (bigger) image. That's worse, but still not that common IMHO.
[+] [-] 323|3 years ago|reply
Programmers do it all day ... with text files.
Would you say the same thing if when you deleted some code it would actually still be there at the end of the file, after two pages of spaces?
When you delete something and save it in a "final" format (like a PNG), you expect nothing which was deleted to be there.
[+] [-] pavon|3 years ago|reply
[+] [-] Retr0id|3 years ago|reply
[+] [-] olliej|3 years ago|reply
1. Take screenshot
2. Open screenshot
3. Edit screenshot
4. Save screenshot
I don't think that "Save As..." the common case.
[+] [-] HALtheWise|3 years ago|reply
[+] [-] ProgramMax|3 years ago|reply
(I'm the PNG spec chair and also the person who discovered Snipping Tool is vulnerable.)
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] layer8|3 years ago|reply
[+] [-] TrianguloY|3 years ago|reply
Or alternatively press the notification -> draw something -> control+c -> close then paste.
I rarely save as file, no need, but I guess I've sometimes do it so I need to be careful.
[+] [-] Hansenq|3 years ago|reply
[+] [-] Retr0id|3 years ago|reply
[+] [-] ornornor|3 years ago|reply
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] recursive|3 years ago|reply
[+] [-] Retr0id|3 years ago|reply
You should notice that the file size didn't actually get any smaller after you cropped it. The full-size image file is not truncated before the cropped version is written. The left-behind data can be recovered.
[+] [-] legrande|3 years ago|reply
[+] [-] SAI_Peregrinus|3 years ago|reply
[+] [-] ffhhj|3 years ago|reply
[+] [-] rldjbpin|3 years ago|reply
i will let someone test the same technique on those cases but empirically i've had screenshots as little as a couple KB this way.
[+] [-] gjsman-1000|3 years ago|reply
[+] [-] Syonyk|3 years ago|reply
That two different tools fail in the same, "surface level invisible" but mighty convenient, and "Whoopsie, file operations are hard!" way... raises some interesting questions.
Mostly, "What else of this nature is present in all our modern operating systems?" Because this sort of failure sure looks an awful lot like the "Underhanded C" contest from 2008: http://www.underhanded-c.org/_page_id_17.html Redact an image, while leaking a lot of information in the process to someone who "knows the trick."
> This is an excellent example of the contest’s philosophy: make the code extremely simple, innocent, obvious, and wrong.
[+] [-] saagarjha|3 years ago|reply