---
id: CVE-2026-51807
title: >-
  Heap-based out-of-bounds write in j2k_precinct_subband::parse_packet_header()
  in OpenHTJ2K versions 0.18.3 and earlier (fixed in v0.18.4) caused by missing
  bounds validation before coding-pass lengths are written to
  j2k_codeblock::pass_l…
summary: >-
  Heap-based out-of-bounds write in j2k_precinct_subband::parse_packet_header()
  in OpenHTJ2K versions 0.18.3 and earlier (fixed in v0.18.4) caused by missing
  bounds validation before coding-pass lengths are written to
  j2k_codeblock::pass_l…
severity: critical
cvss: 9.8
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'
cwe:
  - CWE-121
published: '2026-07-14'
updated: '2026-07-17'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-51807'
references:
  - url: 'https://github.com/osamu620/OpenHTJ2K/blob/main/CHANGELOG'
    label: cve@mitre.org
  - url: 'https://github.com/osamu620/OpenHTJ2K/commit/0778b93'
    label: cve@mitre.org
  - url: 'https://github.com/osamu620/OpenHTJ2K/compare/0778b93...v0.18.4'
    label: cve@mitre.org
  - url: 'https://github.com/osamu620/OpenHTJ2K/releases'
    label: cve@mitre.org
tags:
  - nvd
epss: 0.00671
epssPercentile: 0.49938
ingestedAt: '2026-07-18T14:23:38.116Z'
---

## Overview

Heap-based out-of-bounds write in j2k_precinct_subband::parse_packet_header() in OpenHTJ2K versions 0.18.3 and earlier (fixed in v0.18.4) caused by missing bounds validation before coding-pass lengths are written to j2k_codeblock::pass_length[128]. A crafted JPEG 2000 codestream containing malformed PPM packet headers can trigger a heap-based out-of-bounds write in j2k_precinct_subband::parse_packet_header() in source/core/coding/coding_units.cpp due to missing bounds validation for the j2k_codeblock::pass_length[128] array which can lead to heap corruption and process termination.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
