logoalt Hacker News

Exif Smuggling (2025)

80 pointsby rolphyesterday at 9:06 PM24 commentsview on HN

Comments

BoppreHyesterday at 10:00 PM

Oh, that's clever. It's not just hiding the payload in the Exif, it's hiding the fact that the payload came from the network at all, by reading it from the browser cache (presumably after embedding the image into a page the user visited).

So you have a package that doesn't include (directly) malicious code or make network calls, yet it can still run malicious code from the network. This is much better than simple obfuscation because you can vary the payload, like a command-and-control server.

show 1 reply
Omni5cienceyesterday at 10:14 PM

Why is this a link to a random fork that has no commits, rather than the original?

Grom_PEyesterday at 10:34 PM

It isn't necessary to use Exif to embed arbitrary data inside an image. Could as well use PNG extra chunk, JFIF app marker, or simply append data to the end of the file.

It would be more interesting to devise a method that survives all extra data stripping and re-encoding, perhaps taking advantage of deterministic encoders, assuming they don't randomize pixel data on purpose.

In other words: turning the image data stream itself into a polyglot.

show 2 replies
_defyesterday at 11:49 PM

Many many years ago I saw someone using an image hoster which only checked mime type, and not filename. That's the important bit after all right? Uploading an image as image.php worked, and if the exif comment contained php code, it ran.

mkoryakyesterday at 9:59 PM

I hid my toy vibe coded site's code inside the alpha channel of its logo. https://dogself.com

I probably should have minified it too...

ale42yesterday at 9:30 PM

Weren't similar techniques already used years ago by malvertizers to hide malicious code into images published for ads so it wouldn't be detected? (although it might have been more like steganography)

show 3 replies
porphyrayesterday at 9:44 PM

Mildly annoying how almost everything strips out EXIF data nowadays, in part due to security concerns like this, and then I can't find out what camera, lens, and settings were used to take photos.

show 1 reply
motohagiographytoday at 12:07 AM

is this within the category of normal steganographic encodings and packers, or does it have the ability to execute itself? you can encode anything as anything. I am interpreting it's a slightly interesting tool to fool signature based detection, but isn't something like running a weird machine in an external decoder.