OpenJPEG JPEG2000 mcc record Code Execution Vulnerability
An out-of-bounds heap write in OpenJPEG's parsing of mcc records in JPEG2000 files can lead to heap corruption and arbitrary code execution. An attacker could exploit this by tricking a user into opening a malicious JPEG2000 file, often embedded in a PDF.
Originally disclosed on Cisco Talos
An exploitable code execution vulnerability exists in the jpeg2000 image file format parser as implemented in the OpenJpeg library. A specially crafted jpeg2000 file can cause an out of bound heap write resulting in heap corruption leading to arbitrary code execution.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code increments the record counter without reallocating memory when duplicate mcc indices prevent the search loop from finding a match, leading to an out-of-bounds pointer that is later written to.
Impact
A specially crafted JPEG2000 file could cause heap corruption and potentially lead to arbitrary code execution under attacker control, though the CVSS vector indicates high attack complexity.
What the attacker needed
Victim opens a malicious JPEG2000 file; file may be embedded in a PDF
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
OpenJPEG is a library that reads JPEG2000 images. A bug in how it handles a certain part of the file format (mcc records) lets an attacker write data outside the intended memory area, which can crash the program or let the attacker run their own code. The victim just needs to open a malicious image file, for example inside a PDF.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.