NVIDIA nvJPEG2000 Coding Style Component index out-of-bounds write vulnerability
The NVIDIA nvJPEG2000 library fails to validate the component index in the Coding Style Component segment of a JPEG2000 file, allowing an out-of-bounds write. An attacker can supply a malicious file to corrupt memory and potentially execute arbitrary code.
Originally disclosed on Cisco Talos
A memory corruption vulnerability exists in the Coding Style Component handling of the NVIDIA nvJPEG2000 library version 0.8.0. A specially crafted JPEG2000 file can lead to an out-of-bounds write with arbitrary data which can lead to further memory corruption and 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 library does not validate that the component index (Ccoc) is less than the number of components (Csiz) before using it to index an array, leading to an out-of-bounds write.
Impact
An attacker could achieve remote code execution by supplying a malicious JPEG2000 file.
What the attacker needed
CUDA-enabled GPU; malicious JPEG2000 file
The fix
The vulnerability was fixed in a vendor patch release.
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.
A JPEG2000 file contains a field that tells the decoder which image component a setting applies to. The library uses this number as an array index without checking if it is within the allocated array, so a crafted file can write data past the end of the array. This memory corruption could let an attacker run their own code.
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.