Bug 1531897

Summary: Integer Overflow in PdfXRefStreamParserObject::ParseStream
Product: [Fedora] Fedora EPEL Reporter: probefuzzer <probefuzzer>
Component: podofoAssignee: Dan Horák <dan>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: epel7CC: carnil, dan, manisandro
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
PoC to trigger this vulnerability none

Description probefuzzer 2018-01-06 14:43:42 UTC
on latest version of PoDoFo (RELEASE_0.9.5_rc1), there is an integer overflow in the PdfXRefStreamParserObject::ParseStream function (src/base/PdfXRefStreamParserObject.cpp), which can cause denial of service via a crafted pdf file.

src/src/base/PdfXRefStreamParserObject.cpp:125:64: runtime error: signed integer overflow: 3 + 9223372036854775807 cannot be represented in type 'long int [3]'

To reproduce the issue, compile PoDoFo with UBSAN "-fsanitize=undefined", then execute: podofoimgextract $POC OUTPUT_DIR

The POC file can be downloaded from:

Comment 1 probefuzzer 2018-01-06 14:45 UTC
Created attachment 1377905 [details]
PoC to trigger this vulnerability

Comment 2 Salvatore Bonaccorso 2018-01-08 20:18:01 UTC
@probefuzzer: This issue was assigned CVE-2018-5295, was it reported upstream?

Comment 3 probefuzzer 2018-01-11 21:48:11 UTC
(In reply to Salvatore Bonaccorso from comment #2)
> @probefuzzer: This issue was assigned CVE-2018-5295, was it reported
> upstream?

Thanks for your work. 
We have notified podofo developers via mailing list.