Can you trust digital signatures in PDF files? - harlan4096 - 17 January 20
Quote:
Researchers try to modify the contents of a signed PDF file without invalidating the signature.
Hardly a company or government agency exists that does not use PDF files. And they often use digital signatures to ensure the authenticity of such documents. When you open a signed file in any PDF viewer, the program displays a flag indicating that the document is signed, and by whom, and gives you access to the signature validation menu.
So, a team of researchers from several German universities set out to test the robustness of PDF signatures. Vladislav Mladenov from Ruhr-Universität Bochum shared the team’s findings at the Chaos Communication Congress (36С3).
The researchers’ task was simple: Modify the contents of a signed PDF document without invalidating the signature in the process. In theory, cybercriminals could do the same to impart false information or add malicious content to a signed file. After all, clients who receive a signed document from a bank are likely to trust it and click on any links in it.
The team selected 22 popular PDF viewers for various platforms, and systematically fed them the results of their experiments.
PDF file structure
First, a few words about the PDF format. Each file consists of four main parts: the header, which shows the PDF version; the body, which shows the main content seen by the user; the Xref section, a directory listing the objects inside the body and their locations (for displaying the content); and the trailer, with which PDF viewers start to read the document. The trailer contains two important parameters that tell the program where to start processing the file, and where the Xref section begins.
Integrated in the format is an incremental update function that allows the user to, for example, highlight part of the text and leave comments. From a technical point of view, the function adds three more sections: updates for the body, a new Xref directory, and a new trailer. That effectively makes it possible to change how the objects are seen by the user, and to add new content. In essence, a digital signature is also an incremental update, adding another element and corresponding sections to the file.
Incremental saving attack (ISA)
First, the team tried to add extra sections to the file with another incremental update using a text editor. Strictly speaking, that’s not an attack — the team simply used a function implemented by the creators of the format. When a user opens a file that’s been modified in this way, the PDF reader usually displays a message saying that the digital signature is valid but the document has been modified. Not the most enlightening message, especially not for an inexperienced user. Worse, one of the PDF viewers (LibreOffice) did not even show the message.
The next experiment involved removing the two final sections (that is, adding an update to the body, but not the new Xref and trailer). Some applications refused to work with such a file. Two PDF viewers saw that the sections were missing and automatically added them without notifying the reader about a change in content. Three others swallowed the file without any objection.
Next, the researchers wondered what would happen if they simply copied the digital signature into their own “manual” update. Two more viewers fell for it — Foxit and MasterPDF.
In total, 11 of the 22 PDF viewers proved vulnerable to these simple manipulations. What’s more, six of them showed absolutely no signs that the document opened for viewing had been modified. In the other five cases, to reveal any sign of manipulation, the user had to enter the menu and check the validity of the digital signature manually; simply opening the file was insufficient.
...
Continue Reading
|