Skip to content
Memory corruption Advisory Advanced CVE-2024-0142

NVIDIA nvJPEG2000 cSIZ out-of-bounds write vulnerability

The nvJPEG2000 library fails to validate the component index (Cqcc) in a QCC segment against the number of components (Csiz) declared in the SIZ segment, leading to an out-of-bounds write. An attacker can supply a malicious .jp2 file to trigger memory corruption, potentially leading to arbitrary code execution.

Dimitrios Tatsis Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

A memory corruption vulnerability exists in the Image Decoding functionality of NVIDIA nvJPEG2000 0.8.0. A specially crafted .jp2 file can lead to an out-of-bounds write.

Dimitrios Tatsis, on Cisco Talos

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

Likely the library fails to validate that the component index (Cqcc) from a QCC segment is less than the number of components (Csiz) declared in the SIZ segment before using it to index into the allocated component array.

Impact

This could lead to memory corruption and potentially arbitrary code execution.

What the attacker needed

CUDA-enabled GPU; victim opens a malicious .jp2 file

How it was found

  1. Craft a .jp2 file with a SIZ segment specifying a small Csiz value.
  2. Include a QCC segment with a Cqcc value larger than Csiz.
  3. Open the file with nvJPEG2000 to trigger the out-of-bounds write.

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.

The library reads a number from the file that says how many components the image has, and uses it to allocate an array. Later, it reads another number that says which component to work on, but it does not check that this second number is within the array size. By providing a large number, an attacker can make the library write outside the allocated memory, which can crash the program or allow code execution.

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.

More by Dimitrios Tatsis

View all

21 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.