7 ms·
PNG Parser Differential
- rvnx 5y agoFascinating!
- keyle 5y agoWell it's late December but this might be the coolest hack this year for me!
- angryfeller 5y agocool!
- pokemod97 5y agoIt is clear that images are a mistake.
- tambourine_man 5y agoComputers, actually.
- keyle 5y agoComputers are the children of humans which arguably are a mistake too... So really, blame the universe!
- codetiger 5y agoUniverse so so huge to judge, lets say blame atom.
- wizzwizz4 5y agoAtoms are not atomic. Blame number.
- mhh__ 5y ago"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move"
- mewse 5y agoThe apple pie was delicious, though. Totally worth it.
- noway421 5y agoMind = blown. Hello world on Chrome, Hello Apple on Safari.
- dunham 5y agoIf you save it to desktop, the icon says hello world and quicklook says hello apple.
- moron4hire 5y agoNow that is a WTF
- noduerme 5y agoI noticed that too. Even weirder, this is the case when saving from Firefox (which displays HELLO WORLD) and when saving from Safari.
- Sniffnoy 5y agoI mean, of course it is, it's just saving the PNG; it's not going to decode it and then re-encode it or something!
- noduerme 5y agoSince the desktop icon is scaled down, it has to be parsed at some point and saved back out at icon size. The fact that it says HELLO WORLD on the icon even if you're saving it from Safari means that whatever code is shrinking it into a little icon is parsing it differently from what's being used to display it at full size.
- astrange 5y agoThat’s not surprising, some image formats come with separate thumbnail images to make them faster to decode.
- nyanpasu64 5y agohttps://www.hackerfactor.com/blog/index.php?/archives/895-Connecting-the-iDOTs.html https://www.hackerfactor.com/blog/index.php?/archives/895-Co... > on the first retina iPads, decoding PNGs was a huge portion of the total launch times for some apps, while one of the two cores sat completely idle. Could they distribute decoding PNG files to a thread pool, instead of making multithreaded PNG files? Or would this fail for single large PNG files?
- Retr0id 5y agoDecompressing zlib/DEFLATE streams, in the general case, is an inherently serial task. It cannot be meaningfully parallelised. The "trick" used by Apple, and a few other encoders, is to flush the zlib state every so often (ZLIB_FULL_FLUSH), which means that subsequent data is both byte alligned, and does not make any backreferences to before the sync. If you know where these sync points are (Apple encodes this information in their non-standard "iDOT" chunk) then you can start decompressing from that point, in an isolated thread. There are ongoing discussions as to how this metadata could be standardised: https://github.com/w3c/PNG-spec/issues/54 https://github.com/w3c/PNG-spec/issues/54
- vbphprubyjsgo 5y agoI think that's what restart markers are for in JPEG from the original spec. IIRC in JPEG you can have markers that are marked as "crucial for proper decode" and programs should reject the image if they don't understand them. Maybe the latter was from PNG I forget.
- lifthrasiir 5y agoTechnically speaking you can also speculatively decode Huffman coded bitstreams because the use of canonical Huffman tree means that the end-of-block symbol is almost likely the longest code and has no 0 bits, so you can start decoding at a long string of 1 bits. Of course this doesn't solve an issue of shared LZSS window across multiple blocks.
- xyzzy_plugh 5y ago
- togaen 5y agoFascinating.
- mikotodomo 5y agoOMG this could be used to deanonymize people on nanochan. One person reacts one way on the image and another reacts the other way.
- jeroenhd 5y agoiOS and macOS may be a small player in worldwide computer use, but they're not small enough that you can identify anyone with just this flag. Unless you're in North Korea, saying you're using Apple software isn't really that much of an identifying feature. It can definitely be used for fingerprinting, though, especially if Apple ever fixes their PNG decoder.
- LeoPanthera 5y agoOnly if they do not use Tor Browser, which is based on Firefox. Firefox on Macs has its own PNG decoder and shows "Hello World".
- jkrubin 5y agoThis is objectively very cool.
- colejohnson66 5y agoA tangentially related trick involves gamma correction http://www.ericbrasseur.org/gamma.html http://www.ericbrasseur.org/gamma.html https://superuser.com/q/579216 https://superuser.com/q/579216
- est 5y agoI remember an old .png which renders differently in IE6, Chrome and Firefox. Anyone still got the file?
- giantrobot 5y agoIs it this one? [0] IIRC it's the lack of handking the gAMA tag properly. [0] https://www.howtogeek.com/149223/why-do-chrome-and-internet-explorer-display-this-image-completely-differently/ https://www.howtogeek.com/149223/why-do-chrome-and-internet-...
- dmitshur 5y agoI've tried decoding the image with a png decoder at hand, and got 'hello world'. Guess it belongs to the "other software" category. :)
- jiong103 5y agowow
- abagheri43 5y agoIt was a great article, thank you for this sentence
- jordiburgos 5y agoI am on MacOS. The miniature in the desktop icon of the file shows "Hello World", but opening the file shows "Hello Apple".
- PawelDecowski 5y agoIf you view it in Finder in gallery mode, the picture in the the gallery says “Hello Apple”, while the preview in the sidebar says “Hello World”: https://i.imgur.com/Ef1UpCv.png https://i.imgur.com/Ef1UpCv.png
- grandchild 5y agoInteresting. On the iPad on Firefox in the link preview when long-pressing the link it shows "Hello World", but "Hello Apple" when actually opened. On the same iPad in Safari, it says "Hello Apple" both in the long-press preview and the full page :)
- pingsl 5y agoI am on macOS. Safari shows "Hello Apple", while Brave shows "Hello World"...
- motohagiography 5y agoIs there a conjecture that says for a field with given a degree of complexity, a given string or function of a can be encoded equivalently in a number of different ways that is proportional to its size and maybe complexity class? Between this and project zero's analysis (https://news.ycombinator.com/item?id=29568625 https://news.ycombinator.com/item?id=29568625) of NSO using compression encoding to create a virtual machine for calculating exploit offsets, while unrelated except at a very high level of abstraction, it reminds me conceptually of cryptographic hash collisions, where over a large enough search space or field / domain of complexity there are many equivalent encodings or homonyms/isomorphisms. The issue with the NSO exploit was they found that the compression encoding for a font was Turing complete, and then wrote a virtual architecture in it, and then ran programs on it that did the calculations necessary for their exploit. This png encoding issue is different, but if you abstract it upwards to find a general principle it may be the effect of, it's like there is fast rule where if if you know the size or definition of the field of possibilities, and then have a definition of a given string in it, the function that describes or defines that string will also yield all strings whose evaluation is the same. It's like Kolmolgorov complexity, but where instead of finding the smallest progam to compute something, it's: given the number of instructions to define programs over a field of inputs of a given size, there are N programs beneath length L that are equivalent. Sort of a showerthought, but it's interesting to think that our ideas of encodings and general isomorphisms may be instances of the same concept linked by a sort of "imaginary" function.
- Jerrrry 5y agohttps://en.wikipedia.org/wiki/Verifiable_computing https://en.wikipedia.org/wiki/Verifiable_computing
- motohagiography 5y agoWow, thank you. Totally forgot about FHE, this is the underlying principle of why FHE must work theoretically.