
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-5342 is a heap out-of-bounds read vulnerability in LibRaw's nikon_load_padded_packed_raw() function, affecting all versions up to and including 0.22.0. The flaw resides in src/decoders/decoders_libraw.cpp and is triggered when processing crafted TIFF/NEF image files with inconsistent load_flags and raw_width metadata values. It was discovered and reported on March 16, 2026, and publicly disclosed on April 2, 2026. The vulnerability carries a CVSS v3.1 base score of 5.3 (Medium) and a CVSS v4.0 base score of 5.5 (Medium) (GitHub Advisory, Red Hat Bugzilla).
The root cause is improper restriction of memory buffer operations (CWE-119 / CWE-125): the function allocates a row buffer sized from the load_flags metadata field, but the inner loop iterates raw_width / 2 times, accessing buf[icol*3], buf[icol*3+1], and buf[icol*3+2] — requiring (raw_width/2) * 3 bytes. No validation enforces that load_flags >= (raw_width / 2) * 3, so a crafted TIFF/NEF file with a small load_flags value and a large raw_width causes a heap buffer over-read. The attack is remotely exploitable with no authentication or user interaction required beyond supplying a malicious image file to an application using LibRaw. The fix (commit b8397cd) replaces the load_flags-based buffer sizing with a computed bytesperrow derived directly from raw_width, eliminating the mismatch (GitHub Issue #795, Fix Commit, PoC Repo).
Successful exploitation causes a heap buffer over-read, which can crash the LibRaw-based application, resulting in a denial of service. The CVSS scoring reflects no confidentiality or integrity impact — the primary consequence is availability loss (application crash/abort). Applications that process user-supplied or remotely fetched RAW image files (e.g., image viewers, converters, web services accepting NEF/TIFF uploads) are at risk of being crashed by a single malicious file (GitHub Advisory, GitHub Issue #795).
A public proof-of-concept exploit is available, consisting of a crafted TIFF file (poc_nikonpadded_oob.tif) and build/execution instructions that reproduce the heap-buffer-overflow with AddressSanitizer output (PoC Repo). The CVSS v4.0 exploit maturity is rated "Proof of Concept." There is no evidence of in-the-wild exploitation at this time, and the vulnerability is not listed in the CISA KEV catalog. The EPSS score is approximately 0.045%, indicating low probability of active exploitation in the near term (GitHub Advisory).
load_flags to a value between 2000 and 64000 (e.g., 3040) and set raw_width to a value where (raw_width/2) * 3 exceeds load_flags (e.g., raw_width = 2034 requires 3051 bytes but load_flags = 3040). The reference PoC file poc_nikonpadded_oob.tif demonstrates this (PoC Repo).LibRaw::unpack(), which dispatches to LibRaw::nikon_load_padded_packed_raw() for Nikon padded packed RAW files.load_flags bytes, then the inner loop reads beyond the buffer end at buf[icol*3+2] when icol exceeds the buffer capacity, causing a heap-buffer-overflow read.heap-buffer-overflow in LibRaw::nikon_load_padded_packed_raw() (GitHub Issue #795).load_flags relative to raw_width) in upload directories or temporary processing folders.LIBRAW_EXCEPTION_IO_CORRUPT or abnormal termination signals (SIGABRT, SIGSEGV) during RAW image processing; AddressSanitizer output referencing nikon_load_padded_packed_raw if instrumented builds are in use.Upgrade LibRaw to version 0.22.1, which includes the fix in commit b8397cd45657b84e88bd1202528d1764265f185c. The patch replaces the load_flags-based buffer allocation with a computed bytesperrow derived from raw_width, eliminating the mismatch. If immediate patching is not possible, restrict processing of untrusted or externally sourced TIFF/NEF image files and implement input validation on image file sources. Downstream distributions (Fedora, openSUSE, SUSE) have issued updated packages incorporating this fix (Fix Commit, GitHub Advisory, Red Hat Bugzilla).
The vulnerability was reported to the LibRaw project via GitHub Issue #795 by researcher biniamf on March 16, 2026, with a detailed technical write-up and PoC. The LibRaw maintainer responded promptly, and the fix was committed and released in version 0.22.1 by April 6, 2026. Red Hat tracked the issue via Bugzilla and the oss-security mailing list carried a disclosure post. Multiple Linux distributions (Fedora, openSUSE/SUSE) issued security advisories and updated packages. No significant broader media coverage or notable social media discussion has been identified beyond standard vulnerability tracking feeds (GitHub Issue #795, Red Hat Bugzilla).
Fix availability across major Linux distributions and their releases.
bookworm
libraw: 0.20.2-2.1+deb12u2
sid
libraw: 0.22.1-1
trixie
libraw: 0.21.4-2+deb13u1
bionic (esm-apps)
ufraw
bionic (esm-infra)
libraw
devel
libraw: 0.22.1-1ubuntu1
focal (esm-apps)
darktable
focal (esm-infra)
libraw
jammy
libraw: 0.20.2-2ubuntu2.22.04.3
jammy (esm-apps)
darktable
noble
libraw: 0.21.2-2.1ubuntu0.24.04.2
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."