-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(false alarm) overflow exploit on 0.25 001900 64bit #2
Comments
Can you attach your test file and I will investigate. This issue doesn't sound familiar, however there are many changes in v0.26. |
I've shoved it in an archive to avoid anyone accidentally getting infected, assuming I'm correct that this is malware. I suspect the payload (assuming this isn't just some incredibly weird quirk of random chance) is for Android. Is exiv2 is included in Android? It seems possible that it's targeted at some other lib and exiv just happens to choke on it. background news from last year: securityaffairs.co/wordpress/51043/mobile-2/android-cve-2016-3862-flaw.html |
I've never built exiv2 for Android. I've run the Exiv2 command (both v0.25 and v0.26) on your file on MacOS-X and nothing unusual happened. The image does contain a user comment with binary data:
However I don't feel exiv2 is doing anything harmful. If this is a security issue being exposed by Exiv2, I assure you of my cooperation to address and fix this matter. Perhaps you can explain your use case again. Are you using Exiv2 on a desktop to inspect the metadata from a image taken with an Android device? So, we're discussing Exiv2 on a Linux Desktop and not discussing a build of Exiv2 on Android. Is that right? |
Correct. I'm using Exiv2 on Arch Linux (on my laptop) to look at this photo taken with my phone. My suspicion is that some sort of malware on the phone is infecting the EXIF data with an exploit, with the hope (on the malware author's part) that the image will be uploaded to web services running software vulnerable to EXIF overflow. If you do a search for EXIF overflow it seems that there is precedent for this kind of attack. I'm not sure what I should do with this. I'm not a security researcher so it's a bit confusing. After re-running the command I'm not seeing the same failed directory change error from the first log which is frustrating. Exiv2 isn't necessarily the intended target and 0.26 doesn't do anything weird when parsing these same images, so I'm not sure there's anything for you to do here. Hopefully it's nothing. I will flag the Exiv2 package on Arch Linux as out of date and probably remove that image from my previous comment later now that you have a copy. |
Thanks for marking Exiv2 on Arch as "out of date". I'm going to have a look at this on Linux (Ubuntu 16.04 and Fedora). If necessary, I'll install Arch Linux on a VM. Exiv2 parses the UserComment as binary data. It doesn't assume it's a nul terminated ascii string. And, while the length of the comment at 2296 bytes is quite long, however it is not causing an overflow. The length field is sane and not reaching outside the EXIF segment which is embedded in the JPG. So, I feel calm and relaxed. I will investigate your file on both v0.25 and v0.26 on Linux as this subject deserves careful attention. Thank You for the file, I think you can safely remove references from this thread. |
Looks like someone beat me to it on flagging the package. It's been flagged for about a month. I think this image is harmless on Exiv2. I've just carefully re-read the log that I pasted in my first comment. It appears that when Exiv2 printed the contents of the comment field, a bunch of "stuff" was dumped to the terminal, some of that "stuff" ended up inserted after my prompt. I must have then hit enter myself (!) while my prompt looked like this: If I just type I guess it's still undesirable that Exiv2 generated* the erroneous "stuff," but as mentioned earlier it behaves sanely on a more recent build. As for why photos taken with my camera have such weird comments.. maybe it is malware, or maybe it's Samsung being "helpful" somehow. Thanks for taking a look over things. *Edit: not generated, but perhaps just faithfully printed what was already there? |
Google search for Edit: a search for "samsung EXIF user comment" seems to show this is a common, and old, recurring "bug" with Samsung cameras. Wonder what they're putting in there. |
I went back to the phone and tagged one of the photos with a bunch of text. The output from Exiv2 is slightly different. So my theory is that they're storing that user-added metadata in the User Comment field. False alarm. Probably. Doubt there's any need to waste more time on it. :) Thank you again. |
Here's a little forensic test:
Some of this (at the start and finish) looks sane. However it's mostly binary stuff. Samsung should be store their binary sauce in the MakerNote and not in UserComment. I'm going to close this. |
I was looking at a photo taken with an Android phone this morning and it appeared to trigger an overflow exploit after hitting the comment block.
I know 0.25 is an older version, but I was wondering if this is/was a known issue? A quick search seems to indicate that EXIF exploits were pretty popular last year, but the build I am running is the version currently packaged with Arch Linux. I would not be surprised to learn other distros ship that or even older versions.
I guess this is mostly gibberish, the payload wasn't crafted for this platform, luckily. But to my eyes this looks like it could be used to successfully perform an exploit.
Building from the github source, I don't see anything anywhere near as scary (just an EXIF comment full of "junk" characters) which makes me wonder whether there was a known fix since 0.25?
The text was updated successfully, but these errors were encountered: