CVE-2023-2804
libjpeg-turbo: heap-buffer-overflow in h2v2_merged_upsample_internal() at /libjpeg-turbo/jdmrgext.c
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · March 26, 2023
Updated · November 21, 2025
Description
A heap-based buffer overflow issue was found in libjpeg-turbo in the h2v2_merged_upsample_internal() 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.
Statement
This CVE does not affect libjpeg-turbo v2.1.x and prior. Red Hat Enterprise Linux ships libjpeg-turbo v2.0.90 and prior. Vulnerable code is not present in our code-base. Hence, it's not affected.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 6.5CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
CWE-122 · Heap-based Buffer Overflow