Hacker News new | ask | show | jobs
by enjoytheview 38 days ago
PDF has been an entry point since forever, it is extremely complex and can in some cases even run javascript, it has a huge attack surface.
1 comments

Why can't Apple just sandbox the damn thing? Run the renderer in a VM, call it a day.

Or just spend a few billion tokens rewriting the whole chain in a memory safe language. This nonsense is inexcusable in 2026

I sincerely believe you need much more than one billion tokens to rewrite the entire PDF dependency stack in a memory safe language. I think you underestimate how many features PDF has.
I wish that Apple today was a little more like the Apple that ruthlessly murdered the floppy disc and Flash.
Seriously though, I wonder why nobody really attempted to dethrone PDF yet. How hard can it be (famous last words) to design a document format that allows what people generally expect from a PDF, but without the multimedia and interactive parts that are dangerous?
Because the dangerous parts are not the multimedia and interactive parts. These parts are rarely used. Even if you remove these parts from your PDF reader it’s not a meaningful security improvement. Almost all exploits are in the boring 2D text/graphics/images parts.
Network effect. Most documents are PDF. You would need at least backward compatibility, which would mean opening doors to the existing problem.
Got it. So if I want to hack anything, check if it can open PDF files first.
Microsoft tried with (Open)XPS and failed
Firefox has been working on this and are making good headway over the last few years.
Considering they’ve also made pdf.js, I have hope.
Two problems.

PDFs may need to be further forwarded or edited on user's machine(s). Doing this in VM might save your device, only to pass the problem further down the road to a more vulnerable system.

The safe thing to do is to disarm the file - convert it in a blast proof VM. The conversion can and probably should be further tuned to explicitly disable some of the crazier, more moronic features of the format, sacrificing compatibility for safety. The same should be done with all other binary formats. It costs next to nothing, considering how crazy OP are today's phones. I wonder why it has not been done yet.

The other problem: I am not 100% sure if a clean rewrite would yield a safe viewer. As others have mentioned, PDFs can contain scripts. You'd always have to run them in VMs.

It's sandboxed, not in a VM but using the *OS sandbox/seatbelt. Running all renderers in a separate VM on a consumer phone sounds like a terrible time when you need to stay competitive regarding performance, responsiveness, etc.
i mean, we already run all apps in separate VMs...
On which OS? Android and iOS don’t. Not even Qubes does.
it offers just enough cover and deniability. Q.e.d this sub thread.

it's a feature. expect next exploit to also be pdf or image related.

The sandbox is just another layer
A bulletproof vest is just another layer.
yes, and it usually doesn't cover anything except your torso :)