An update released last week for the OpenJPEG library addresses several bugs and important security issues, including a flaw that can be exploited to execute arbitrary code using specially crafted image files.
OpenJPEG is an open-source library designed for encoding and decoding JPEG2000 images, a format that is often used to embed image files inside PDF documents. OpenJPEG is used by several popular PDF readers, including PDFium, the default PDF viewer in Google Chrome.
Cisco Talos researchers discovered that OpenJPEG is plagued by an out-of-bounds heap write issue. The vulnerability allows an attacker to execute arbitrary code on the targeted user’s system if they can trick the victim into opening a specially crafted JPEG2000 image or a PDF document containing such a file.
In an attack scenario described by experts, the attacker attaches a malicious file to an email, or uploads it to a file hosting service, such as Dropbox or Google Drive, and sends the link to the victim.
“Due to an error while parsing mcc records in the jpeg2000 file, out of bounds memory can be accessed resulting in an erroneous read and write of adjacent heap area memory,” Cisco explained in its advisory. “Careful manipulation of heap layout and can lead to further heap metadata process memory corruption ultimately leading to code execution under attacker control.”
The vulnerability was reported to OpenJPEG developers in late July and it was patched last week with the release of version 2.1.2. The issue is tracked as CVE-2016-8332 and it has been assigned a CVSS score of 7.5, which puts it in the high severity category.
This is not the first time Cisco Talos researchers have found a vulnerability related to OpenJPEG. In June, experts disclosed a flaw in the library that affected only the PDFium viewer in Chrome. The weakness did not impact standalone OpenJPEG builds as it was caused by a process specific to Google’s web browser.