| Name | CVE-2017-14151 | 
| Description | An off-by-one error was discovered in opj_tcd_code_block_enc_allocate_data in lib/openjp2/tcd.c in OpenJPEG 2.2.0. The vulnerability causes an out-of-bounds write, which may lead to remote denial of service (heap-based buffer overflow affecting opj_mqc_flush in lib/openjp2/mqc.c and opj_t1_encode_cblk in lib/openjp2/t1.c) or possibly remote code execution. | 
| Source | CVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more) | 
| Debian Bugs | 874430 | 
Vulnerable and fixed packages
The table below lists information on source packages.
| Source Package | Release | Version | Status | 
|---|
| openjpeg2 (PTS) | bullseye | 2.4.0-3 | fixed | 
|  | bullseye (security) | 2.4.0-3+deb11u1 | fixed | 
|  | bookworm | 2.5.0-2+deb12u2 | fixed | 
|  | bookworm (security) | 2.5.0-2+deb12u1 | fixed | 
|  | trixie | 2.5.3-2.1~deb13u1 | fixed | 
|  | forky, sid | 2.5.3-2.1 | fixed | 
The information below is based on the following data on fixed versions.
| Package | Type | Release | Fixed Version | Urgency | Origin | Debian Bugs | 
|---|
| openjpeg2 | source | jessie | (not affected) |  |  |  | 
| openjpeg2 | source | stretch | 2.1.2-1.1+deb9u2 |  |  |  | 
| openjpeg2 | source | (unstable) | 2.3.0-1 |  |  | 874430 | 
Notes
[jessie] - openjpeg2 <not-affected> (Vulnerable code introduced later, see #874430)
https://blogs.gentoo.org/ago/2017/08/16/openjpeg-heap-based-buffer-overflow-in-opj_mqc_flush-mqc-c/
https://github.com/uclouvain/openjpeg/commit/afb308b9ccbe129608c9205cf3bb39bbefad90b9
https://github.com/uclouvain/openjpeg/issues/982