CVE-2023-2804: Buffer Overflow
A heap-based buffer overflow issue was discovered in libjpeg-turbo in h2v2mergedupsampleinternal() function of jdmrgext.c file. The vulnerability can only be exploited with 12-bit data precision for which the range of the sample data type exceeds the valid sample range, hence, an attacker could craft a 12-bit lossless JPEG image that contains out-of-range 12-bit samples. An application attempting to decompress such image using merged upsampling would lead to segmentation fault or buffer overflows, causing an application to crash.
Other sources
A heap-based buffer overflow issue was found in libjpeg-turbo in the h2v2mergedupsampleinternal() function in the jdmrgext.c file. This issue can only be used with 12-bit data precision for which the range of the sample data type exceeds the valid sample range. This could allow an attacker to craft a 12-bit lossless JPEG image that contains out-of-range 12-bit samples. An application attempting to decompress such an image using merged upsampling would lead to segmentation fault or buffer overflows, causing an application to crash.
A heap‑based buffer overflow exists in libjpeg‑turbo’s h2v2mergedupsampleinternal() function when processing 12‑bit lossless JPEG images. An attacker could craft an image containing out‑of‑range 12‑bit samples that, when decompressed with merged upsampling enabled, may trigger a segmentation fault or buffer overflow, resulting in an application crash.
— Microsoft
In libjpeg-turbo, there is heap-buffer-overflow at /libjpeg-turbo/jdmrgext.c:126 in h2v2mergedupsampleinternal(), leadin causing crash.
https://github.com/libjpeg-turbo/libjpeg-turbo/issues/675 https://github.com/libjpeg-turbo/libjpeg-turbo/commit/9f756bc67a84d4566bf74a0c2432aa55da404021
— Red Hat
Red Hat, Inc. CVE-2023-2804: Heap Based Overflow libjpeg-turbo
— Microsoft
Affected Software
Remediation
Patch Available
Patch Available
Event History
Frequently Asked Questions
What is the vulnerability ID for this issue?
The vulnerability ID for this issue is CVE-2023-2804.
What is the severity of CVE-2023-2804?
The severity of CVE-2023-2804 is medium with a severity value of 6.5.
Which software is affected by CVE-2023-2804?
Libjpeg-turbo versions up to 2.1.91 and 2.1.90, as well as version 3.0, are affected by CVE-2023-2804.
What is the description of CVE-2023-2804?
CVE-2023-2804 is a heap-based buffer overflow issue in libjpeg-turbo, specifically in the h2v2_merged_upsample_internal() function in the jdmrgext.c file.
How can an attacker exploit CVE-2023-2804?
An attacker can exploit CVE-2023-2804 by using 12-bit data precision, causing the range of the sample data type to exceed the valid sample range.