Bug 1443940 (CVE-2017-7975)

Summary: CVE-2017-7975 jbig2dec: Integer overflow in jbig2_build_huffman_table allows OOB write
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abhgupta, cbuissar, deekej, kseifried, pzhukov, tiwillia, twaugh, zdohnal
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-19 16:08:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1443898, 1443899, 1443933, 1443934    
Bug Blocks: 1443943    

Description Adam Mariš 2017-04-20 10:00:35 UTC
Artifex jbig2dec 0.13, as used in Ghostscript, allows out-of-bounds writes because of an integer overflow in the jbig2_build_huffman_table function in jbig2_huffman.c during operations on a crafted JBIG2 file, leading to a denial of service (application crash) or possibly execution of arbitrary code.

Upstream bug:

https://bugs.ghostscript.com/show_bug.cgi?id=697693

Comment 1 Adam Mariš 2017-04-20 10:00:50 UTC
Acknowledgments:

Name: Jiaqi Peng (Chinese Academy of Sciences)

Comment 2 Andrej Nemec 2017-04-20 15:09:39 UTC
Created jbig2dec tracking bugs for this issue:

Affects: epel-all [bug 1443899]

Comment 4 Cedric Buissart 2017-07-10 09:57:04 UTC
Note: in 64 bits environment, OOB write concerns only the 0xffffffffxxxxxxxx range. This range is at best read-only, thus would not lead to a possible arbitrary code execution.

Comment 6 Cedric Buissart 2017-07-19 08:42:35 UTC
Reducing impact to low based on comment 4.

Comment 9 Cedric Buissart 2017-07-19 16:05:50 UTC
The vulnerability requires user defined Huffman table for the vulnerability to be triggered. ghostscript versions prior to 9.00 are not be affected by this vulnerability.
As a result, 
* RHEL-7 is shipped with only the 64 bit version of ghostscript, and is only vulnerable to DoS
* RHEL-5 & 6 are not affected.