Bug 416653

Summary: PDF Deflate bombs may cause crashes or resource exhaustion
Product: [Applications] okular Reporter: Jens Mueller <jens.a.mueller+kde>
Component: PDF backendAssignee: Okular developers <okular-devel>
Status: RESOLVED UPSTREAM    
Severity: normal CC: aacid, nate, postix
Priority: NOR    
Version First Reported In: 1.3.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Trivial PDF deflate bomb (01)
Trivial PDF deflate bomb (02)
Trivial PDF deflate bomb (03)

Description Jens Mueller 2020-01-23 16:38:10 UTC
Streams in PDF files can be compressed, which may result in "deflate bombs" if not handled by the PDF processing application. Find attached three simple PDF compression bombs (10MB on disk to 10GB in memory). Note the compressed stream can be used multiple times in a single PDF document. The PDF files have been gzipped as a precaution mechanism, in order to prevent DoS when accidentally previewing them (gunzip them before the actual testing). Maybe resource limitations should be enforced by Okular / Poppler?
Comment 1 Jens Mueller 2020-01-23 16:38:51 UTC
Created attachment 125332 [details]
Trivial PDF deflate bomb (01)
Comment 2 Jens Mueller 2020-01-23 16:39:43 UTC
Created attachment 125333 [details]
Trivial PDF deflate bomb (02)
Comment 3 Jens Mueller 2020-01-23 16:39:57 UTC
Created attachment 125334 [details]
Trivial PDF deflate bomb (03)
Comment 4 Albert Astals Cid 2020-01-23 23:02:55 UTC
Okular doesn't do any pdf parsing.

Please report upstream at poppler.
Comment 5 Jens Mueller 2020-01-24 17:17:42 UTC
I opened an issue for Poppler: https://gitlab.freedesktop.org/poppler/poppler/issues/878
If it's handled there, things should be fine.