Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signature wrapping attack #158

Closed
beat2 opened this issue Mar 6, 2019 · 3 comments
Closed

signature wrapping attack #158

beat2 opened this issue Mar 6, 2019 · 3 comments

Comments

@beat2
Copy link

beat2 commented Mar 6, 2019

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.

@andreasrosdal

This comment has been minimized.

@andreasrosdal andreasrosdal pinned this issue Mar 7, 2019
beat2 pushed a commit to Glue-Software-Engineering-AG/OpenPDF that referenced this issue Mar 7, 2019
@andreasrosdal andreasrosdal unpinned this issue Mar 8, 2019
@andreasrosdal
Copy link
Contributor

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

@beat2
Copy link
Author

beat2 commented Mar 8, 2019

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants