# CVE-2023-2804: A heap-based buffer overflow issue was discovered in libjpeg-turbo in h2v2mergedupsampleinternal() function of jdmrgext.c file.

- Severity: Medium 6.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.20%, higher than 69% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2023-05-25T00:00:00.000Z
- Modified: 2026-06-17T05:53:28.837Z
- Weaknesses: CWE-122, CWE-787
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: redhat

## Description

A heap-based buffer overflow issue was discovered in libjpeg-turbo in h2v2_merged_upsample_internal() 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.

(As written by CVE List.)

## Affected

- libjpeg-turbo: Fixed in libjpeg-turbo v3.0 (beta2)
- libjpeg-turbo libjpeg-turbo: 2.1.90

## Every score

- CISA-ADP: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`

## References

- <https://github.com/libjpeg-turbo/libjpeg-turbo/issues/675> (exploit, issue-tracking, patch)
- <https://github.com/libjpeg-turbo/libjpeg-turbo/issues/668#issuecomment-1492586118> (exploit, issue-tracking, patch)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2208447> (issue-tracking, patch)
- <https://access.redhat.com/security/cve/CVE-2023-2804> (third-party-advisory)
- <https://github.com/libjpeg-turbo/libjpeg-turbo/commit/9f756bc67a84d4566bf74a0c2432aa55da404021> (patch)
- <https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-01006.html>

## Sources

- CVE List: [CVE-2023-2804](https://www.cve.org/CVERecord?id=CVE-2023-2804), CVE Terms of Use, modified 2025-01-16
- NVD: [CVE-2023-2804](https://nvd.nist.gov/vuln/detail/CVE-2023-2804), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-2804 · Whole record: https://cve.day/CVE-2023-2804.json · Rebuilt by cve.day 2026-11-25T22:58:24.384Z
