LinuxPDF is an open-source project that boots a 32-bit Linux system on a RISC-V emulator running inside a PDF file, using the JavaScript that PDF readers can execute. It was released in February 2025 by the developer known as ading2210 on GitHub, also behind DoomPDF, and it remains one of the clearest demonstrations of how far a format most people see as a static document can be pushed.
Key points of LinuxPDF in 30 seconds
- Engine: a fork of Fabrice Bellard’s TinyEMU, compiled to asm.js with Emscripten 1.39.20.
- Guest: 32-bit Buildroot by default, with a 64-bit Alpine option that is about twice as slow.
- Speed: 30 to 60 seconds to boot the kernel, over 100 times slower than normal.
- Licence: GPL v3, with a live demo for Chromium-based browsers.
The repository has more than 5,000 stars. It has no practical use, but it is a neat case study in emulation, compiling C to JavaScript and the attack surface of everyday documents.
Architecture: from C to JavaScript inside a PDF
The PDF format defines its own JavaScript dialect. Adobe Acrobat implements the full specification, including HTTP requests and monitor enumeration, while browser PDF viewers expose only a small subset. That subset is enough for arbitrary computation, with very limited input and output. Because the engine has no WebAssembly, the author compiles the emulator with an old Emscripten release that still emits asm.js.
There is no canvas for the display: each row of pixels is a separate PDF form text field filled with ASCII characters. Input comes from a virtual keyboard made of buttons plus a text box. The slowness has a specific cause: the V8 engine in Chrome’s PDF viewer runs with its JIT compiler disabled, and the author says there is no way around it.
Building and trying it
Building is only supported on Linux. The script downloads Emscripten and writes the PDF to the out directory, which you can serve locally and open in a browser. As with any third-party repository, read the script first and run it in a throwaway VM or container:
git clone https://github.com/ading2210/linuxpdf
cd linuxpdf
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
./build.sh
cd out
python3 -m http.server 8080Code language: PHP (php)For the 64-bit build, change the BITS variable in build.sh and expect an even slower boot.
What it means for administrators
LinuxPDF exploits no bug and never leaves the viewer’s sandbox, but it shows that a PDF can carry a complex program that runs as soon as it is opened. In corporate environments it makes sense to turn off PDF JavaScript where nobody needs it: in Firefox by setting pdfjs.enableScripting to false, which can be pushed by policy, and in Acrobat and Reader from the JavaScript section of Preferences. Keep in mind that some government forms rely on PDF JavaScript for calculations and validation, so test before rolling it out widely.
Frequently asked questions
Which PDF viewers does LinuxPDF run in?
It targets the PDF viewer in Chromium-based browsers, where the demo is hosted.
Why is it so slow?
Because the V8 engine in Chrome’s PDF viewer has its JIT disabled, so everything is interpreted.
Is LinuxPDF malware?
No. It is an open-source proof of concept that stays within the limits of the PDF viewer.
Sources:
