Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

PDF files are code. They are a variant of postscript which is a Turing complete language. People have written web servers in postscript I understand.

The issue you state is a property of three things:

1. The underlying language/vm allows code and data to be interchanged (c++).

2. The underlying vm allows memory to be overwritten and buffer lengths to be exceeded to start with.

3. Pdf allows arbitrary code to execute on your computer.

My point demonstrated.



PDF is a very small subset of PostScript as a programming language, centered around objects that are usually in a compressed stream. Pages, text, images, drawings, etc. are all objects and appropriately linked¹. The language itself cannot really do more than creating objects and dictionaries; no programming is left.

Embedded JavaScript is another matter, but it's not needed to be executed for parsing the document.

_____________

¹ This gives rise to interesting applications, e.g. you can remove pages or images by just removing a link in the PDF. Yet the object would then still be there. There are some PDFs out there where sensitive information is buried in unlinked objects that still exist within the file. But that's obviously besides the point.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: