Bug 1267983 (CVE-2015-6581)

Summary: CVE-2015-6581 openjpeg: Double free vulnerability in opj_j2k_copy_default_tcp_and_create_tcd
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: erik-fedora, jcapik, manisandro, oliver, phracek, rdieter, slawomir, tpopela
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-28 04:42:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1267986, 1267987, 1267988, 1267989    
Bug Blocks: 1267985    

Description Adam Mariš 2015-10-01 14:06:56 UTC
Double-free vulnerability was found in opj_j2k_copy_default_tcp_and_create_tcd function in j2k.c in OpenJPEG before r3002, as used in PDFium in Google Chrome before 45.0.2454.85, allowing remote attacker to execute arbitrary code or cause a denial of service (heap memory corruption) by triggering a memory-allocation failure.

The opj_j2k_copy_default_tcp_and_create_tcp() function memcpy's a top-level
struct and then replaces pointers to memory owned by the original struct
with new blocks of memory. Unfortunately, an early return can leave the
copy with pointers to memory it doesn't own, which causes problems when
cleaning up the partially-initialized struct.

Upstream bug:


Upstream patch:


Comment 1 Adam Mariš 2015-10-01 14:15:45 UTC
Created openjpeg tracking bugs for this issue:

Affects: fedora-all [bug 1267987]

Comment 2 Adam Mariš 2015-10-01 14:15:50 UTC
Created mingw-openjpeg tracking bugs for this issue:

Affects: fedora-all [bug 1267988]

Comment 3 Adam Mariš 2015-10-01 14:15:54 UTC
Created openjpeg2 tracking bugs for this issue:

Affects: fedora-all [bug 1267989]

Comment 4 Huzaifa S. Sidhpurwala 2015-10-28 04:42:23 UTC
Please Note:

This seems to be valid for openjpeg2 only. The code has been redesigned completely and the upstream patch only applies to the openjpeg2 code. There's no such function call in openjpeg 1.5.1. (As per bug #1267987). Since Red Hat Enterprise Linux does not ship openjpeg2, it is not affected.


Not vulnerable. This issue did not affect the versions of openjpeg as shipped
with Red Hat Enterprise Linux 6 and 7.