News for hackers. Stuff that matters.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by time-domain0 on Thursday December 13, 2018 @12:09AM (#18669978)
If you read the PDF spec from the late 90's, it is Stephen King novel-scary... container format, multiple encodings, encryption, embedded binaries, embedded JavaScript and more.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by zubspace on Thursday December 13, 2018 @02:53AM (#18670584)
While working with the PDF format I sometimes get the impression that this complexity is what Adobe wants. As a result, Adobe Reader is the only viewer that implements the entire spec and can handle all (or most) quirks.

This is especially apparent when trying to edit arbitrary PDF files, which is sometimes not so easy or even impossible. Just the definition of fonts and the text layout is already so complicated that this is the logical consequence.

But perhaps the format has simply grown and led to additional requirements such as PDF/A, PDF/X, PDF/E and now PDF 2.0, the next standard that makes everything even more complex... Will this every stop?

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by hsivonen on Thursday December 13, 2018 @11:44AM (#18673696)
PDF is an unusual format in the sense that it had a rather specific thing it tried to do and then it achieved that goal, so that it could be considered "done", but the product it was most associated with, Acrobat, tried to expand still.

PDF has the semantics of a digital print that is resolution-independent and supports copypaste and search (mostly by mapping glyphs back to text).

In addition to resolution independence being something that's higher-level than strictly "digital print", being able to capture transparency is such a higher-level feature.

From the above perspective, PDF peaked in 1.4 when it got transparency support. Supporting roughly the PDF 1.4 feature set was that allowed the Mac Preview app be good enough for Mac users so that Apple could stop bundling Acrobat Reader with Macs.

After 1.4, PDF has gotten better compression algorithms that don't really change what the format is about. PDF/A and PDF/X fit well the notion of PDF as "digital print".

But Adobe has been trying to leverage Acrobat/PDF to other areas that don't fit the notion of "digital print". These include pre-Macromedia acquisition attempts to make PDFs a more dynamic platform and later inclusion of 3D models in PDFs. Other PDF viewers still work for users most of the time without this stuff, which is a signal of what PDF really is to users ("digital print").

(Filling in paper-like forms, while not true to the notion that PDF is a final-form format sort of make sense from the point of view of digital paper, though.)

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by pwg on Thursday December 13, 2018 @08:48AM (#18672252)
> While working with the PDF format I sometimes get the impression that this complexity is what Adobe wants. As a result, Adobe Reader is the only viewer that implements the entire spec and can handle all (or most) quirks.

While that certainly does play in Adobe's favor, the complexity of the spec. is also what occurs when over time new features, some never even envisioned by the original creators, are bolted on to keep the whole "relevant" and/or to add new "features" to keep the 'thing' from becoming obsolete.

We can certainly argue whether the addition of different features was worth the complexity increase, but simply taking an existing system and bolting on the latest "hotness" to use to add to the checklist of "why one should upgrade" features also produces similar levels of complexity.

So some of the complexity increase is merely the fact that the pdf spec. has been evolved to do things it was likely never designed to do in the first place.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by SmellyGeekBoy on Thursday December 13, 2018 @05:10AM (#18671193)
The same could be said for the Microsoft Office file formats.

Or PSD, for that matter.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by tonyedgecombe on Thursday December 13, 2018 @05:33AM (#18671278)
The Office formats are well specified, they are complex because that is the nature of the software but it is a world away from something like PSD or even PDF.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by gpvos on Thursday December 13, 2018 @07:53AM (#18671939)
PDF is actually quite well specified, there are not many holes in the specification itself.[0] As to what Adobe Reader will do when it encounters an out-of-spec file, that is a lot fuzzier.

On the other hand, the Office file formats (especially Word) have many un- or underspecified cases.

[0] The only one I know of is finding the end of compressed inline image data.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by hnick on Thursday December 13, 2018 @08:19PM (#18677641)
I agree, the PDF spec is great, and very easy to understand (if slow to wade through). The hardest parts are when you have to duck out to read another spec for a contained format like TrueType.

Regarding Reader, I work with PDFs a lot, and the majority of issues have a fairly common pattern. The supplier has created a PDF in a 3rd party tool, which is invalid in a subtle way (production printers in particular are very specific about what they want to accept).

But it works fine in Adobe Reader, since it was built to be very tolerant in what it accepts, so it's often hard to convince the non-technical users that the file has an issue. It's great for end users but has meant that a lot of tools out there just didn't have to try too hard to make PDFs that mostly work, so programming workflows can be an issue.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by tonyedgecombe on Thursday December 13, 2018 @09:14AM (#18672399)
I found quite a few areas that were vague when I was working with it.

The advantage of the office formats is they are Zip files with a ton of XML, ie they are well defined. The application parts are another matter of course.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by BlackFingolfin on Thursday December 13, 2018 @10:53AM (#18673185)
Just because something is XML doesn't mean it is "well-defined".
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by tonyedgecombe on Friday December 14, 2018 @02:40AM (#18679167)
No, but XML parsing is a solved problem, PDF parsing isn't.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by tinus_hn on Saturday December 15, 2018 @05:07AM (#18687833)
The original criticism was that some parts are just binary blobs encoded in XML elements, which wouldn’t suprise me at all, with Microsoft being allowed to tick the ‘XML file format’ checkbox and still getting to keep the binary format advantages.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by gpvos on Friday December 14, 2018 @04:37AM (#18679612)
I see. I was mostly referring to semantic problems, of which I heard there are a lot (I haven't really worked with Office internals much), and also I was thinking of the pre-XML Office formats.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by brendyn on Friday December 14, 2018 @05:06AM (#18679751)
I remember reading in the past that Microsoft had corrupted the ISO standards body to publish essentially fake standards that were different to what MS Office actually produced, so software like Libreoffice would output files that didn't work properly in Office or visa versa. Are you saying that now this is not the case and they are full specified? I sometimes tell people about this so I want to make sure I have my facts straight.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by Quarrelsome on Thursday December 13, 2018 @06:07AM (#18671420)
old binary formats were pretty insane though. Lots of magic to pull the file size down.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by gpvos on Friday December 14, 2018 @07:06AM (#18680247)
Okay, apparently I totally didn't notice the release of PDF 2.0 a year ago, even though I was working a lot with PDFs at that time. Also, this new version is an ISO standard that costs 198 CHF to download, so I hereby predict that it is basically dead in the water, since few people will bother implementing it. The new features also don't seem very interesting, and from what I gather the spec is still backwards compatible despite the major version number increment.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by aidos on Thursday December 13, 2018 @04:35AM (#18671051)
I actually enjoy reading the PDF spec - it’s here for anyone who wants to take a look https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PD...

Like every bit of business software, there’s a load of stuff that shouldn’t be in there. It’s a really flexible container format though, and every one of these features went in because there was a need. Times change, things change and it could do with a tidy up, but it’s probably impossible without breaking everything for a load of businesses.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by AnaniasAnanas on Thursday December 13, 2018 @12:33AM (#18670079)
I was under the impression that PDF was created as a response to postscript being "too programmable" and not "document enough" but then they decided that PDF is too minimal and so they ended up bloating it beyond what PostScript ever was by including JavaScript, Flash, and other trash in it.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by kibibu on Thursday December 13, 2018 @01:56AM (#18670364)
It's got a 3d model viewer in it
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by ryacko on Thursday December 13, 2018 @02:05AM (#18670401)
So does TempleOS.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by kibibu on Thursday December 13, 2018 @02:33AM (#18670506)
Are you suggesting we replace PDF with TempleOS?
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by grawlinson on Thursday December 13, 2018 @02:51AM (#18670578)
It would be an improvement!
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by fabricexpert on Thursday December 13, 2018 @04:01AM (#18670901)
I'm waiting for someone to post a wasm templeOS build which has some been modified to open pdfs immediately
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by danmg on Thursday December 13, 2018 @06:03PM (#18676958)
Not divine.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by ryacko on Thursday December 13, 2018 @03:06AM (#18670635)
No, just run Adobe in a virtual machine with constrained access to other files.

Although TempleOS clearly is a divine revelation.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by ct520 on Thursday December 13, 2018 @03:35AM (#18670783)
I’ll get IT on it STAT! Regular employees going to love accessing PDFs in a VM
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by yjftsjthsd-h on Thursday December 13, 2018 @08:48AM (#18672256)
Honestly, it's possible to make VM windows show up as if they were normal programs, or you could just do things like Chrome-level internal sandboxing. There's no reason this has to be clunky.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by kibibu on Thursday December 13, 2018 @09:04AM (#18672344)
Adobe Reader is already sandboxed a la Chrome.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by ryacko on Thursday December 13, 2018 @06:10PM (#18677000)
According to Zerodium prices, VM escape costs as much as LPE, so it is unclear if there will be much of a security improvement beyond 2x.

Although virtual machine hypervisors don’t automatically update, unlike Adobe or Windows.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by AnaniasAnanas on Thursday December 13, 2018 @06:53PM (#18677239)
I am pretty sure that hypervisors update just like any other software, via the package manager.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by russellbeattie on Thursday December 13, 2018 @01:53AM (#18670361)
I've done exactly that. Mark my words, a PDF will be the first computer program to gain full sentience.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by saagarjha on Thursday December 13, 2018 @02:06AM (#18670404)
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by cpeterso on Thursday December 13, 2018 @02:57AM (#18670599)
For a walk through PDF's history and file format, check out Chas Emerick's 2018 Red Monk tech talk: "Building 100 year systems in the shadow of PDF".

https://www.youtube.com/watch?v=5EPn6plqkEs

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by SlowRobotAhead on Thursday December 13, 2018 @12:42AM (#18670119)
I don’t know if this is true, but I’ve been told that the pdf spec at one point did/does contain some MS DOS emulation.

I’m seriously close to banning acrobat the program for my employees, just haven’t found a rock solid alternative that I can trust to not implement the same dumb parts of the spec.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by sebazzz on Thursday December 13, 2018 @12:47AM (#18670144)
Pretty sure that pdf.js from Firefox is safe. At least it runs as sandboxed javascript in the browser. I believe a standalone client may exist as well.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by AnaniasAnanas on Thursday December 13, 2018 @02:21AM (#18670456)
My issue with pdf.js is that it is really bad at copying. every time that I try to copy something from it every word (and sometimes different letters from a word) end up in a different line. I also had issues with rendering, in some (rare) cases I had it show squares instead of the actual content.

Not to mention that it is actually horrifyingly slow compared to most of the viewers that I tried.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by avian on Thursday December 13, 2018 @02:29AM (#18670486)
pdf.js had its share of security vulnerabilities in the past. e.g. https://blog.mozilla.org/security/2015/08/06/firefox-exploit...
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by occamrazor on Thursday December 13, 2018 @02:33AM (#18670503)
I think that chrome uses (used?) poppler, and is quite good for displaying pdfs.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by hannob on Thursday December 13, 2018 @02:48AM (#18670567)
no, chrome uses its own engine called pdfium.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by ksec on Thursday December 13, 2018 @04:02AM (#18670909)
Did PDF version 2.0 made any improvement to clarity? I think it was released last year.
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by ernst_klim on Thursday December 13, 2018 @03:11AM (#18670657)
Is djvu a viable alternative and if so, why isn't it used as widely as pdf?
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by ungzd on Thursday December 13, 2018 @04:10AM (#18670947)
DJVU is raster format. It's intended for scans and archiving printed media. It's possible to use it for documents produced digitally, but I don't think it will be a good idea.

PDF "core" is not that bad, but 90s "multimedia" craze turned it into badly designed graphical application runtime.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by ernst_klim on Thursday December 13, 2018 @04:36AM (#18671053)
Thanks for disambiguation, the raster-vector part is really a major difference. Is PS a viable alternative (even though it is a programming language itself)?
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by ungzd on Thursday December 13, 2018 @02:58PM (#18675466)
AFAIK, PDF is mostly a container for PS with compression and better handling of fonts (BTW, can fonts be embedded in PS? How fonts are sent to printer?).

Still, both formats are too much printing-oriented. Reading documentation in PDF on computer screen is not especially pleasant, and unbearable on phones.

Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by wbl on Thursday December 13, 2018 @11:32AM (#18673588)
How do you embed fonts?
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by fiddlerwoaroof on Thursday December 13, 2018 @03:26AM (#18670745)
Weren’t there licensing or patent issues?
Re:50 CVEs in 50 Days: Fuzzing Adobe Reader by mpweiher on Thursday December 13, 2018 @10:17AM (#18672833)
What do you mean "read"? Implemented.

Though obviously not the full thing. Nobody does that. Not even Adobe does that.