Bug 1487347 (CVE-2017-14041)

Summary: CVE-2017-14041 openjpeg: Stack-based buffer over-write in pgxtoimage function in bin/jp2/convert.c
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: dominik.mierzejewski, erik-fedora, extras-orphan, hobbes1069, jaromir.capik, manisandro, nforro, oliver, phracek, rdieter
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-09-04 04:02:40 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: 1487362, 1487363, 1487364, 1487365, 1487366    
Bug Blocks: 1487756    

Description Pedro Sampaio 2017-08-31 17:14:15 UTC
A stack-based buffer overflow was discovered in the pgxtoimage function
in bin/jp2/convert.c in OpenJPEG 2.2.0. The vulnerability causes an
out-of-bounds write, which may lead to remote denial of service or
possibly remote code execution.

Upstream bug:

https://github.com/uclouvain/openjpeg/issues/997

Upstream patch:

https://github.com/uclouvain/openjpeg/commit/e5285319229a5d77bf316bb0d3a6cbd3cb8666d9

References:

https://bugzilla.novell.com/show_bug.cgi?id=1056562

Comment 1 Pedro Sampaio 2017-08-31 17:59:39 UTC
Created mingw-openjpeg tracking bugs for this issue:

Affects: fedora-all [bug 1487363]


Created mingw-openjpeg2 tracking bugs for this issue:

Affects: fedora-all [bug 1487365]


Created openjpeg tracking bugs for this issue:

Affects: fedora-all [bug 1487362]


Created openjpeg2 tracking bugs for this issue:

Affects: epel-all [bug 1487366]
Affects: fedora-all [bug 1487364]

Comment 2 Huzaifa S. Sidhpurwala 2017-09-04 04:01:37 UTC
Analysis:

A specially crafted JPG2 file can cause OOB write, which can cause application crash. Code execution seems to be unlikely on modern systems and the way buffer stack is overwritten (via fscanf() as seen from the patch).

Comment 3 Dominik Mierzejewski 2017-10-09 12:26:49 UTC
Is openjpeg-1.3 (RHEL6) and 1.5.1 (RHEL7) affected at all? I couldn't get 1.5.1's image_to_j2k tool to crash using the exploit image from Novell bugzilla.