Openpdf: signature wrapping attack

Created on 6 Mar 2019  路  3Comments  路  Source: LibrePDF/OpenPDF

iText 2.1.7 and OpenPDF too is affected by a signature wrapping attack. (For details see https://pdf-insecurity.org/).

Problem:
OpenPDF just uses the last part of the ByteRange to calculate the length a signature.

Proposed solution:
Instead one should take the length of all parts (first signed part, unsigned part which must contain only the signature, and the second signed part).

See: AcroFields#getSignatureNames

As an example, this document passes all checks:

https://pdf-insecurity.org/download/exploits/3_eXpert_PDF_12_Ultimate/siwa.pdf

This should return false instead of true: AcroFields#signatureCoversWholeDocument

Does anybody see a problem with the supposed solution? If not I can provide a PR.

bug help wanted security

Most helpful comment

That's ok for me. I will provide one more PR for a "feature" maybe next week, but this is not related to security. (Support for embedding both CRL and OCSP information, that means a mix of the two).

All 3 comments

Thanks, pull requests are welcome.

@beat2 @rtfarte Do you think OpenPDF is ready for a new release now, where this signature wrapping attack is fully fixed?

That's ok for me. I will provide one more PR for a "feature" maybe next week, but this is not related to security. (Support for embedding both CRL and OCSP information, that means a mix of the two).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sjalouali picture sjalouali  路  3Comments

michaelhugi picture michaelhugi  路  6Comments

kdekooter picture kdekooter  路  5Comments

Lonzak picture Lonzak  路  5Comments

marbetschar picture marbetschar  路  5Comments