March 10, 2026
When PDFs bite back
Bypassing Apache Fop PostScript Escaping to Reach GhostScript
A friendly ‘Hello’ PDF turned into a sneaky file peeker
TLDR: A researcher found a way to push a “safe” PDF conversion path into letting Ghostscript read temp files. Comments exploded: security folks say never trust PostScript, devs say they still need PDFs, and everyone’s demanding isolation or redesign as this matters to countless web apps that generate documents.
The dev world is clutching its pearls after a researcher showed how a simple “Hello” PDF—made by feeding text into Apache FOP and then into Ghostscript—could be twisted to peek at temporary files even with Ghostscript’s built‑in “safe mode.” Translation: a tool meant to convert documents got talked into snooping. The demo used a cheeky “Hello Almond” sample and a fuzzing tool to find a path past FOP’s text-escaping, landing in Ghostscript’s lap. The result? Not full system takeover, but enough to read sensitive temp files, and that’s more than spicy enough to light up the comments.
Security diehards screamed “I told you so,” blasting anyone who lets user input near PostScript (the old printer language that’s basically a mini programming language). Devs pushed back: “We escaped everything and still got burned—what more do you want?” Others dragged the Rube Goldberg PDF pipelines that chain XML → FOP → PostScript → Ghostscript → PDF, calling it “print-devops cosplay.” Memes flew: “PDFs are computers,” “Printers are hackers now,” and “Hello Almond” became the new “Hello World.” The thread split three ways: isolate Ghostscript to oblivion (tiny VMs, throwaway containers), render everything to images, or just never process user-supplied stuff. Meanwhile, bug bounty cynics rolled eyes at decades-old tech causing brand-new drama. Patch, sandbox, and pray, says the crowd.
Key Points
- •An application pipeline converts user-supplied XML to PostScript via Apache FOP and then to PDF using GhostScript.
- •GhostScript typically runs with -dSAFER sandboxing, but temporary folders may still be accessible, posing risk.
- •A Docker-based reproduction challenge mirrors the pipeline; the goal is to read a flag from /tmp.
- •The issue was investigated using Jazzer, fuzzing the FOP-to-PostScript and GhostScript parsing pipeline.
- •Apache FOP escapes user input in PostScript strings via PSPainter.writeText() calling PSGenerator.escapeChar().