CVE-2026-5318 LibRaw JPEG DHT losslessjpeg.cpp initval out-of-bounds write

Medium 5.3 Published Updated

Remote attackers can trigger an out-of-bounds write in LibRaw's JPEG parser, potentially leading to code execution or crashes.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-5318?

CVE-2026-5318 is a medium-severity memory corruption vulnerability in Libraw Libraw, published on 2 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

A weakness has been identified in LibRaw up to 0.22.0. This impacts the function HuffTable::initval of the file src/decompressors/losslessjpeg.cpp of the component JPEG DHT Parser. This manipulation of the argument bits[] causes out-of-bounds write. It is possible to initiate the attack remotely. The exploit has been made available to the public and could be used for attacks. Upgrading to version 0.22.1 will fix this issue. Patch name: a6734e867b19d75367c05f872ac26322464e3995. It is advisable to upgrade the affected component.

Weakness: CWE-787, CWE-119

Which versions are affected by CVE-2026-5318?

It affects 1 product.

Products include Libraw Libraw.

How do I fix CVE-2026-5318?

Upgrade to a fixed version.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2026-5318 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-5318 exists.

All Libraw Libraw vulnerabilities

Sources

Also known as DEBIAN-CVE-2026-5318, GHSA-8qw7-rqx6-9gqj, JLSEC-2026-1117, UBUNTU-CVE-2026-5318.

Is CVE-2026-5318 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free