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.
{
"cna_assigner": "VulDB",
"cwe_ids": [
"CWE-119",
"CWE-787"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/5xxx/CVE-2026-5318.json",
"unresolved_ranges": [
{
"extracted_events": [
{
"range": [
{
"introduced": "0.1"
},
{
"last_affected": "0.1"
},
{
"introduced": "0.2"
},
{
"last_affected": "0.2"
},
{
"introduced": "0.3"
},
{
"last_affected": "0.3"
},
{
"introduced": "0.4"
},
{
"last_affected": "0.4"
},
{
"introduced": "0.5"
},
{
"last_affected": "0.5"
},
{
"introduced": "0.6"
},
{
"last_affected": "0.6"
},
{
"introduced": "0.7"
},
{
"last_affected": "0.7"
},
{
"introduced": "0.8"
},
{
"last_affected": "0.8"
},
{
"introduced": "0.9"
},
{
"last_affected": "0.9"
},
{
"introduced": "0.10"
},
{
"last_affected": "0.10"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
}
]
}
]
}{
"extracted_events": [
{
"range": [
{
"introduced": "0.11"
},
{
"last_affected": "0.11"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "0.12"
},
{
"last_affected": "0.12"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "0.13"
},
{
"last_affected": "0.13"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "0.14"
},
{
"last_affected": "0.14"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "0.15"
},
{
"last_affected": "0.15"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "0.16"
},
{
"last_affected": "0.16"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "0.17"
},
{
"last_affected": "0.17"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "0.18"
},
{
"last_affected": "0.18"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "0.19"
},
{
"last_affected": "0.19"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "0.20"
},
{
"last_affected": "0.20"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "0.21"
},
{
"last_affected": "0.21"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"introduced": "0.22.0"
},
{
"last_affected": "0.22.0"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandaloneSingleVersion"
},
{
"range": [
{
"fixed": "a6734e867b19d75367c05f872ac26322464e3995"
}
],
"source": "REFERENCES_COMMIT"
},
{
"original_tag": "0.22.1",
"range": [
{
"fixed": "b860248a89d9082b8e0a1e202e516f46af9adb29"
}
],
"source": "REFERENCES_TAG"
}
]
}
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-5318.json"
[
{
"deprecated": false,
"digest": {
"function_hash": "133194446028387202039164538590990797554",
"length": 1269
},
"id": "CVE-2026-5318-98442b3f",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/libraw/libraw/commit/a6734e867b19d75367c05f872ac26322464e3995",
"target": {
"file": "src/decompressors/losslessjpeg.cpp",
"function": "HuffTable::initval"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"326761413661156394820900884209946624484",
"9393470417408501326808684943003842057",
"235583240642029526265400839232551055324",
"255729870336141752472084508648059580457",
"232132406769837678194374120828729585056",
"275170039955600648939075200053395248899",
"277991561106811252586383934784330613761",
"328581871071293545468715766510115047561",
"291257287519693227265917942841836945041",
"298475588439797613578363806973380941942",
"90510277236790103263695028072102205737"
],
"threshold": 0.9
},
"id": "CVE-2026-5318-c83540d1",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/libraw/libraw/commit/a6734e867b19d75367c05f872ac26322464e3995",
"target": {
"file": "src/decompressors/losslessjpeg.cpp"
}
}
]
"2026-10-21T10:15:38Z"