Same person got Linux working inside a PDF document
An entire kernel and OS running in a PDF. What a time to be alive
Same person got Linux working inside a PDF document
An entire kernel and OS running in a PDF. What a time to be alive
we find things that make us go.
@burnitdown Indeed!
One of the big reasons why is that if you can run an operating system somewhere, you can run a lot --a *lot*-- of kinds of malware. Running Doom, an OS, etc demonstrates the risk without being immediately threatening.
(I am making some mildly informed assumptions here. If I am being Wrong on the Internet maybe someone will improve this description.)
@cypnk since the previous post is Doing Numbers, folks may also enjoy this 2021 zero-click iMessage exploit by notorious Israeli spyware-for-despotic-nation-states firm NSO Group, which involved sending a .gif
file that was actually a PDF that used the now-uncommon JBIG2 black-and-white image compression format which, surprisingly, is Turing-complete.
As this Project Zero blog post explains,
JBIG2 doesn't have scripting capabilities, but when combined with a vulnerability, it does have the ability to emulate circuits of arbitrary logic gates operating on arbitrary memory. So why not just use that to build your own computer architecture and script that!? That's exactly what this exploit does. Using over 70,000 segment commands defining logical bit operations, they define a small computer architecture with features such as registers and a full 64-bit adder and comparator which they use to search memory and perform arithmetic operations. It's not as fast as Javascript, but it's fundamentally computationally equivalent.
And we thought Conways Game of Life implementing and/or/not gates was cool, because you could, in theory, build up a computer to to run Life.
Now we've got PDF Inception, where, like the movie, we realize that time runs slower the more VMs you run inside each other.
I don't get it at all. The whole point of PDFs over ghostscript was to ensure that a document looked the same no matter what screen or printer was being used, and that it was a static format suitable for archiving final product.
Playing DOOM on one is like getting your house foundation to dance.
@marshray @ThreeSigma @brouhaha @cypnk
> "Playing DOOM on one is like getting your house foundation to dance."
true, but it's also a very effective demo of why PDFs have been off and on the most popular phishing / malware vector for the last few years, which is why i created The Pdfalyzer a few years ago: https://github.com/michelcrypt4d4mus/pdfalyzer
It's proven to be a wildly more popular tool than I ever imagined.
@marshray @ThreeSigma @brouhaha @cypnk i also just stumbled on pdftris, which is apparently tetris embedded in a PDF.
@cypnk "only works in Chromium-based browsers"
I wonder if this is "Chrome made a new shitty API and now people are relying on it" came to their PDF reader, or if Acrobat would also work and this is "Firefox doesn't want to implement some weird forgotten corner of the PDF spec that makes this work but could also be a security risk".
Very cool.
Also terrifying.
Raises serious questions about using PDF as a document format.
I guess my big question is how many PDF viewers are defaulted to run this kind of code in a PDF?
One would hope that most have this turned off by default?
🤨
PDF is descended from Postscript (with extras to make it device-independent).
Postscript is a programming language (in the stack-based Forth-like family) and is Turing-complete.
This was ALWAYS going to happen eventually.
(There is no way to turn off the language functionality in PDF without stopping it from displaying documents at all.)
@TerryHancock That's a very good question and it may not be answerable. Thing is, different readers may implement different subsets of the standard, and even that may change between different versions
So every PDF is a mishmash of possibilities
That's funny. Well played.
@cypnk that's awesome!
....but can it run Crysis? 🤣
Well PDF is actually PostScript which is actually Forth, which is a quite capable programming language.
And PostScript is Forth focused on rendering text and images.
Guy runs 'Doom' on a pregnancy test and wait, what?The tradition of running the legendary game Doom on various gadgets and appliances that were not originall...