CVE-2026-21413: LibRaw heap buffer overflow in lossless_jpeg_load_raw

CVE-2026-21413 · Severity: critical · CVSS 9.8 · Published 2026-04-07

LibRaw is a widely used software library for reading and processing RAW image files from digital cameras. A security vulnerability in how the library handles certain compressed image formats allows an attacker to crash applications or potentially execute malicious code by providing a specially crafted image file. This could lead to unauthorized access to data or a complete takeover of systems that automatically process user-uploaded photos.

Technologies: Libraw, Red Hat Enterprise Linux AppStream. Vendors: Libraw, Red Hat.

Quick answers

Is CVE-2026-21413 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-21413 being exploited in the wild.
How severe is CVE-2026-21413?
Critical severity, with a CVSS score of 9.8, published 7 April 2026.
Which products and versions are affected?
Libraw Commit 0b56545, Commit d20315b; Red Hat Enterprise Linux AppStream 8, 9.
Is there a fix for CVE-2026-21413?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2026-21413 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-21413?
Check whether you run Libraw or Red Hat Enterprise Linux AppStream at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A heap-based buffer overflow exists in LibRaw's 'lossless_jpeg_load_raw' function within 'src/decoders/decoders_dcraw.cpp'. The vulnerability is caused by improper validation of the column index ('col') when processing JPEG-compressed RAW files (specifically Canon CR2 files using the CR2Slice tag). An attacker can control the 'cr2_slice' metadata values to calculate an out-of-bounds index for the 'raw_image' buffer. Because the attacker also controls the tone curve table and the JPEG bitstream, they can achieve a controlled 16-bit write to out-of-bounds heap memory. This can be triggered by providing a malicious image file to any application using LibRaw's 'unpack()' function.

Affected products

  • LibRaw LibRaw Commit 0b56545, Commit d20315b
  • Red Hat Enterprise Linux AppStream 8, 9

Timeline

  • 2026-04-07: advisory: Initial advisory published by Talos and NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.