Comment by aemoron

16 hours ago

What's with iOS and pdfs pwning them? Reminds me of the ForcedEntry in Pegasus.

https://projectzero.google/2022/03/forcedentry-sandbox-escap...

https://www.trendmicro.com/en_gb/research/21/i/analyzing-peg...

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.

  • 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

Too huge attack surface. Good candidate for victim trust (who would not open a pdf file on an iPhone?).

So pdf and images are the best vector for iPhones.

Once you escape the parser you have to reach and escape the sandbox and from there reach the kernel.

  • That's why you need Rust in any image decoder. FFMPEG too.

    • The problem here is that pdf is over bloated with features and without strictly defined standard. Rust can't help you with that, or any language for that matter. It's akin to upgrading the security system on a house on fire.

      The best solution would be ditching it completely for a simpler subset of features. But that will never happen.

If it wasn't PDF it'd be something else. It's everything after the PDF that's alarming here - how did they break out of the app sandbox?

I wonder if pdf.js would be more secure since it runs inside a webpage and can benefit from the browser sandboxing. Though I guess iOS has generally managed to keep most of its apps native rather than web app wrappers (as has happened on Windows).

Maybe with LLMs a full rewrite that’s more secure could be done

  • LLM and full rewrite are a recipe for cooking something that still has flaws but also doesn't work that well. The root cause is that PDF is an old format from a more innocent era. A new document standard that keeps up with the technical and security advances, learns about the lessons PDF taught us, and allows for easy conversion from old PDFs, would be the ideal solution.

    Who am I kidding, I think the PDF format will outlive us.

    • > PDF is an old format from a more innocent era

      if apple parsed pdf with (js, swift, rust) none of this would be possible. the problem is memory-unsafe code.

      1 reply →