This is definitely a good brute force strategy I ... think there’s another technique that relies a bit on trusting the printing drivers to do the right thing, where you can tell Ghostscript to print your document, and target another PDF. This should at least remove interactive components in a PDF
It's definitely brute force, in that it's the equivalent of printing a document onto paper and then scanning it back in. This "flattening" is highly effective at sanitising, but also removes all the semantic content in the process; the output should be several times larger than the input (and if it isn't, then it's an indication that something very suspicious was in the input....)
Dangerzone: Convert potentially dangerous PDFs, documents, or images to safe PDF
21–30 of 60 posts
Re: Dangerzone: Convert potentially dangerous PDFs, documents, or images to safe PDF
#22Earlier quoted context omitted.
I used to deal with PDF at my day job. Among all the tools we use in production, Ghostscript probably has the most 0 day. Thankfully we're paranoid about security and run everything in sandbox. Still it's no fun getting nagged by security to upgrade our Ghostscript version.
It's funny how they all seem to have been found by one person (Tavis Ormandy) too. It's like the setup and PostScript standard are so baroque that only one human understands them, and that human takes a week or so every year or two to research and drop another 0day. https://bugs.chromium.org/p/project-zero/issues/detail?id=16...
Re: Dangerzone: Convert potentially dangerous PDFs, documents, or images to safe PDF
#23Earlier quoted context omitted.
If I understand this correctly, a link wouldn't survive this as the pdf is turned into images and then those images back into a pdf. So it's essentially like a scan of very high quality. What you would end up with is an image that looks like a link but would not be clickable.
> Dangerzone can optionally OCR the safe PDFs it creates, so it will have a text layer again I'm not completely sure, but wouldn't this parse links and make them accessible again, possibly even clickable?
Re: Dangerzone: Convert potentially dangerous PDFs, documents, or images to safe PDF
#24This is definitely a good brute force strategy I ... think there’s another technique that relies a bit on trusting the printing drivers to do the right thing, where you can tell Ghostscript to print your document, and target another PDF. This should at least remove interactive components in a PDF
It's definitely brute force, in that it's the equivalent of printing a document onto paper and then scanning it back in. This "flattening" is highly effective at sanitising, but also removes all the semantic content in the process; the output should be several times larger than the input (and if it isn't, then it's an indication that something very suspicious was in the input....)
Which is why when you print a PDF from Firefox, it doesn't look very nice. But it's safer than sending unsanitized PDFs to printers.
Re: Dangerzone: Convert potentially dangerous PDFs, documents, or images to safe PDF
#25Earlier quoted context omitted.
I used to deal with PDF at my day job. Among all the tools we use in production, Ghostscript probably has the most 0 day. Thankfully we're paranoid about security and run everything in sandbox. Still it's no fun getting nagged by security to upgrade our Ghostscript version.
It's funny how they all seem to have been found by one person (Tavis Ormandy) too. It's like the setup and PostScript standard are so baroque that only one human understands them, and that human takes a week or so every year or two to research and drop another 0day. https://bugs.chromium.org/p/project-zero/issues/detail?id=16...
Re: Dangerzone: Convert potentially dangerous PDFs, documents, or images to safe PDF
#26Re: Dangerzone: Convert potentially dangerous PDFs, documents, or images to safe PDF
#27Very nice but fyi: most malicious pdf just contains links to something else,usually shortlinks. Social engineering is hard to mitigate.
Fortunately smart forms require Adobe Viewer, and there's an approval step (similar to agreeing to Excel macros), but after that it can do whatever the hell it likes.
Re: Dangerzone: Convert potentially dangerous PDFs, documents, or images to safe PDF
#28Earlier quoted context omitted.
I used to deal with PDF at my day job. Among all the tools we use in production, Ghostscript probably has the most 0 day. Thankfully we're paranoid about security and run everything in sandbox. Still it's no fun getting nagged by security to upgrade our Ghostscript version.
It's funny how they all seem to have been found by one person (Tavis Ormandy) too. It's like the setup and PostScript standard are so baroque that only one human understands them, and that human takes a week or so every year or two to research and drop another 0day. https://bugs.chromium.org/p/project-zero/issues/detail?id=16...
Re: Dangerzone: Convert potentially dangerous PDFs, documents, or images to safe PDF
#29Very nice but fyi: most malicious pdf just contains links to something else,usually shortlinks. Social engineering is hard to mitigate.
Re: Dangerzone: Convert potentially dangerous PDFs, documents, or images to safe PDF
#30Download Dangerzone So instead of opening a PDF from the internet on my machine, I now run code from the internet on my machine?