# CVE-2026-51235: LibRaw heap buffer overflow in stretch and fuji_rotate functions

Source: https://junglewise.ai/threats/cve-2026-51235-libraw-heap-buffer-overflow-in-stretch-and-fuji-rotate-functions  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-27. Updated: 2026-07-27  
License: CC BY 4.0 with a link back

CVE-2026-51235 · Severity: info · CVSS 7.8 · Published 2026-07-27

LibRaw, a widely used library for processing RAW digital camera images, contains a security vulnerability that can be triggered by a specially crafted image file. If a user opens a malicious Fuji RAW (.RAF) file using an application that relies on this library, the application could crash or allow an attacker to gain unauthorized control over the system. This affects software used for photo editing, viewing, and digital asset management.

Technologies: [Libraw](https://junglewise.ai/threats/technologies/libraw). Vendors: [Libraw](https://junglewise.ai/threats/vendors/libraw).

## Quick answers

**Is CVE-2026-51235 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-51235 being exploited in the wild.

**How severe is CVE-2026-51235?** Informational severity, with a CVSS score of 7.8, published 27 July 2026.

**Which products and versions are affected?** Libraw 0.21.

**Is there a fix for CVE-2026-51235?** 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-51235 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-51235?** Check whether you run Libraw 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

LibRaw 0.21 contains two heap-based buffer overflow vulnerabilities (CWE-122). The first occurs in the stretch() function (src/libraw_cxx.cpp) due to variable confusion between image dimensions and channel counts, leading to out-of-bounds writes. The second occurs in fuji_rotate() (src/decoders/fuji.cpp) where an unsigned short integer overflow during width and pixel aspect ratio multiplication results in an undersized buffer allocation. An attacker can trigger these by providing a maliciously crafted Fuji RAF image with manipulated header metadata. Exploitation requires a user to process the file with an application linked against the vulnerable library, potentially leading to arbitrary code execution or a process crash.

## Affected products

- LibRaw LibRaw 0.21

## Timeline

- 2026-07-27: disclosed: Initial disclosure via NVD and researcher advisory

## References

- [http://libraw.com/](http://libraw.com/)
- [https://github.com/programmervuln/cveadvisory-/blob/main/CVE-2026-51235](https://github.com/programmervuln/cveadvisory-/blob/main/CVE-2026-51235)

## Related threats

- [LibRaw heap-based out-of-bounds read in Nikon makernote parsing](https://junglewise.ai/threats/cve-2026-111272-libraw-through-0-22-2-contains-a-heap-based-out-of-bounds-read)
- [LibRaw numeric conversion overflow in TIFF NewSubfileType parsing](https://junglewise.ai/threats/cve-2026-88387-libraw-0-22-0-contains-an-incorrect-numeric-conversion)
- [LibRaw heap buffer overflow in x3f_load_huffman](https://junglewise.ai/threats/cve-2026-24660-libraw-heap-buffer-overflow-in-x3f-load-huffman)
- [LibRaw heap buffer overflow in lossless_jpeg_load_raw](https://junglewise.ai/threats/cve-2026-21413-libraw-heap-buffer-overflow-in-lossless-jpeg-load-raw)
- [LibRaw heap buffer overflow in HuffTable::initval](https://junglewise.ai/threats/cve-2026-20911-libraw-heap-buffer-overflow-in-hufftable-initval)
