Bug 407338 - Okular segfaults when opening a file digitally signed with portablesigner and Acrobat Reader
Summary: Okular segfaults when opening a file digitally signed with portablesigner and...
Status: RESOLVED UPSTREAM
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 1.7.0
Platform: Arch Linux Linux
: NOR critical
Target Milestone: ---
Assignee: Okular developers
URL: https://gitlab.freedesktop.org/popple...
Keywords:
: 407369 407670 408576 409258 409283 409684 416077 417241 418738 420656 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-05-08 15:45 UTC by Ángel de Vicente
Modified: 2020-04-27 16:15 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Digitally signed documents (one gives the segmentation fault) (151.61 KB, application/x-compressed-tar)
2019-05-08 15:45 UTC, Ángel de Vicente
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ángel de Vicente 2019-05-08 15:45:38 UTC
Created attachment 119916 [details]
Digitally signed documents (one gives the segmentation fault)

SUMMARY

I use the code portablesigner to digitally sign a document, and Okular can read the generated document no problem (see example sample-sig.pdf attached).

My colleagues, who uses ADOBE Acrobat Reader DC Version 2019.010.20099 in a Mac signs the same document, and Okular can read it no problem (see example sample_victor.pdf attached).

But if he signs the file previously signed by me (so as to have it signed by both of us), then Okular segfaults when trying to open the file (see example sample_sig_victor.pdf).

This might not be a problem specific to Okular, since trying to see the signatures with pdfsig (v. 0.76.1), also segfaults:


[angelv@bug]$ pdfsig sample_sig_victor.pdf
Digital Signature Info of: sample_sig_victor.pdf
Signature #1:
  - Signer Certificate Common Name: DE VICENTE GARRIDO ANGEL MANUEL - 30660835H
  - Signer full Distinguished Name: CN=DE VICENTE GARRIDO ANGEL MANUEL - 30660835H,SN=DE VICENTE GARRIDO,givenName=ANGEL MANUEL,serialNumber=IDCES-30660835H,C=ES
  - Signing Time: May 08 2019 12:16:59
  - Signing Hash Algorithm: SHA1
  - Signature Type: adbe.pkcs7.sha1
  - Signed Ranges: [0 - 13426], [18278 - 24071]
  - Not total document signed
  - Signature Validation: Signature is Valid.
  - Certificate Validation: Certificate is Trusted.
Segmentation fault (core dumped)
[angelv@bug]$


SOFTWARE/OS VERSIONS
Linux: ArchLinux 

ADDITIONAL INFORMATION
Comment 1 Oliver Sander 2019-05-08 18:10:41 UTC
Backtrace:

#0  0x00007fffe0181c1f in PL_HashTableLookupConst () from /usr/lib/x86_64-linux-gnu/libplds4.so
#1  0x00007fffe01a3818 in SECOID_FindOID_Util () from /usr/lib/x86_64-linux-gnu/libnssutil3.so
#2  0x00007fffe0ffec59 in NSS_CMSContentInfo_GetContentTypeTag () from /usr/lib/x86_64-linux-gnu/libsmime3.so
#3  0x00007fffe0fffe40 in ?? () from /usr/lib/x86_64-linux-gnu/libsmime3.so
#4  0x00007fffe019f7ee in SEC_ASN1DecoderUpdate_Util () from /usr/lib/x86_64-linux-gnu/libnssutil3.so
#5  0x00007fffe0fffc6b in NSS_CMSDecoder_Update () from /usr/lib/x86_64-linux-gnu/libsmime3.so
#6  0x00007fffe100046d in NSS_CMSMessage_CreateFromDER () from /usr/lib/x86_64-linux-gnu/libsmime3.so
#7  0x00007fffe0d7cea3 in SignatureHandler::CMS_MessageCreate (this=this@entry=0x7fffffffc920, 
    cms_item=cms_item@entry=0x7fffffffc928) at /home/sander/gitlab/poppler/poppler/SignatureHandler.cc:316
#8  0x00007fffe0d7d6a7 in SignatureHandler::SignatureHandler (this=0x7fffffffc920, 
    p7=0x555555e26380 "0\202$\270\006\t*\206H\206\367\r\001\a\002\240\202$\251\060\202$\245\002\001\001\061\017\060\r\006\t`\206H\001e\003\004\002\001\005", p7_length=10285) at /home/sander/gitlab/poppler/poppler/SignatureHandler.cc:273
#9  0x00007fffe0c82ec8 in FormFieldSignature::validateSignature (this=0x555555d97800, doVerifyCert=doVerifyCert@entry=true, 
    forceRevalidation=forceRevalidation@entry=false, validationTime=4294967295)
    at /home/sander/gitlab/poppler/poppler/Form.cc:1731
#10 0x00007fffe0c831c0 in FormWidgetSignature::validateSignature (this=this@entry=0x555555d54b90, 
    doVerifyCert=doVerifyCert@entry=true, forceRevalidation=forceRevalidation@entry=false, validationTime=<optimized out>)
    at /home/sander/gitlab/poppler/poppler/Form.cc:461
#11 0x00007fffe0ef4d3e in Poppler::FormFieldSignature::validate (this=this@entry=0x555555e42f90, opt=opt@entry=1, 
    validationTime=...) at /home/sander/gitlab/poppler/qt5/src/poppler-form.cc:871
#12 0x00007fffe0ef52d1 in Poppler::FormFieldSignature::validate (this=0x555555e42f90, 
    opt=Poppler::FormFieldSignature::ValidateVerifyCertificate) at /home/sander/gitlab/poppler/qt5/src/poppler-form.cc:864
#13 0x00007fffe1052bae in PopplerFormFieldSignature::PopplerFormFieldSignature(Poppler::FormFieldSignature*) ()
   from /home/sander/okular-inst/lib/x86_64-linux-gnu/plugins/okular/generators/okularGenerator_poppler.so
#14 0x00007fffe104337c in PDFGenerator::addFormFields(Poppler::Page*, Okular::Page*) ()
   from /home/sander/okular-inst/lib/x86_64-linux-gnu/plugins/okular/generators/okularGenerator_poppler.so
#15 0x00007fffe103d704 in PDFGenerator::loadPages(QVector<Okular::Page*>&, int, bool) ()
   from /home/sander/okular-inst/lib/x86_64-linux-gnu/plugins/okular/generators/okularGenerator_poppler.so
#16 0x00007fffe103d077 in PDFGenerator::init(QVector<Okular::Page*>&, QString const&) ()
   from /home/sander/okular-inst/lib/x86_64-linux-gnu/plugins/okular/generators/okularGenerator_poppler.so
#17 0x00007fffe103cdc1 in PDFGenerator::loadDocumentWithPassword(QString const&, QVector<Okular::Page*>&, QString const&) ()
--Type <RET> for more, q to quit, c to continue without paging--c
   from /home/sander/okular-inst/lib/x86_64-linux-gnu/plugins/okular/generators/okularGenerator_poppler.so
#18 0x00007fffe96698a7 in Okular::DocumentPrivate::openDocumentInternal(KPluginMetaData const&, bool, QString const&, QByteArray const&, QString const&) () from /home/sander/okular-inst/lib/x86_64-linux-gnu/libOkular5Core.so.9
#19 0x00007fffe9672efb in Okular::Document::openDocument(QString const&, QUrl const&, QMimeType const&, QString const&) () from /home/sander/okular-inst/lib/x86_64-linux-gnu/libOkular5Core.so.9
#20 0x00007fffe981843a in Okular::Part::doOpenFile(QMimeType const&, QString const&, bool*) () from /home/sander/okular-inst/lib/x86_64-linux-gnu/plugins/okularpart.so
#21 0x00007fffe98191bb in Okular::Part::openFile() () from /home/sander/okular-inst/lib/x86_64-linux-gnu/plugins/okularpart.so
#22 0x00007ffff7f3e9f1 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5Parts.so.5
#23 0x00007ffff7f3f986 in KParts::ReadOnlyPart::openUrl(QUrl const&) () from /usr/lib/x86_64-linux-gnu/libKF5Parts.so.5
#24 0x00007fffe981a893 in Okular::Part::openUrl(QUrl const&, bool) () from /home/sander/okular-inst/lib/x86_64-linux-gnu/plugins/okularpart.so
#25 0x00007fffe981a6c2 in Okular::Part::openUrl(QUrl const&) () from /home/sander/okular-inst/lib/x86_64-linux-gnu/plugins/okularpart.so
#26 0x0000555555568642 in Shell::openUrl(QUrl const&, QString const&) ()
#27 0x0000555555568113 in Shell::openDocument(QUrl const&, QString const&) ()
#28 0x00005555555655e8 in Okular::main(QStringList const&, QString const&) ()
#29 0x00005555555620e2 in main ()
Comment 2 Albert Astals Cid 2019-05-08 22:59:28 UTC
Yes, it's a bug in poppler. Can you please report it to https://gitlab.freedesktop.org/poppler/poppler/issues ?
Comment 3 Ángel de Vicente 2019-05-08 23:22:37 UTC
Reported upstream

https://gitlab.freedesktop.org/poppler/poppler/issues/766
Comment 4 Albert Astals Cid 2019-05-18 10:41:03 UTC
*** Bug 407670 has been marked as a duplicate of this bug. ***
Comment 5 Juan Ases García 2019-05-30 21:02:47 UTC
*** Bug 407369 has been marked as a duplicate of this bug. ***
Comment 6 Albert Astals Cid 2019-06-11 21:31:24 UTC
*** Bug 408576 has been marked as a duplicate of this bug. ***
Comment 7 Yuri Chornoivan 2019-06-27 18:48:35 UTC
*** Bug 409258 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2019-06-30 14:20:12 UTC
*** Bug 409283 has been marked as a duplicate of this bug. ***
Comment 9 Yuri Chornoivan 2019-07-10 13:03:28 UTC
*** Bug 409684 has been marked as a duplicate of this bug. ***
Comment 10 Yuri Chornoivan 2020-01-10 10:02:48 UTC
*** Bug 416077 has been marked as a duplicate of this bug. ***
Comment 11 Yuri Chornoivan 2020-01-23 16:47:14 UTC
*** Bug 416637 has been marked as a duplicate of this bug. ***
Comment 12 Yuri Chornoivan 2020-02-06 18:19:12 UTC
*** Bug 417241 has been marked as a duplicate of this bug. ***
Comment 13 Yuri Chornoivan 2020-03-11 15:39:02 UTC
*** Bug 418738 has been marked as a duplicate of this bug. ***
Comment 14 Yuri Chornoivan 2020-04-27 10:43:03 UTC
*** Bug 420656 has been marked as a duplicate of this bug. ***