jesparza/peepdf

Issues with handling modified PDFs

Opened this issue · 0 comments

Hi,

Peepdf seems to have issues with handling some pdfs that have been modified to have somewhat invalid structures, but are still readable with common pdf readers. For example as in attached file test_example1.pdf, if object MediaBox has invalid values peepdf only outputs an error "Error: An error has occurred while parsing an indirect object!!".

Would it be possible to develope peepdf to handle more robust inputs? My thinking is, if I wanted to obfuscate harmful pdfs from being analyzed with peepdf, I could just slightly modify the file so that it is still readable with common pdf readers but invalid for peepdf.

Attached couple examples with embedded test javascript code.

Thanks for creating a great tool!
test_example1.pdf
test_example2.pdf