Every CVE Search/ Get API key

CVE-2018-5785

In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the...

6.5 MediumFix available

CVE-2018-5785 is a medium vulnerability (CVSS 6.5) in Uclouvain Openjpeg, published January 19, 2018. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.33%, the 83rd percentile. Fixed in openjpeg 2.3.0-r3.

In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the opj_j2k_setup_encoder function (openjp2/j2k.c). Remote attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

2.33%Up 1.0 points since Apr 14, 2021
90%50%10%1%

What each source reports

NVD Score used 6.5

In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the opj_j2k_setup_encoder function (openjp2/j2k.c). Remote attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file.

Record
CVE-2018-5785
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
CVSS 2.0
4.3 MediumAV:N/AC:M/Au:N/C:N/I:N/A:P
Weakness
CWE-190
Updated
2026-11-02
CVE List No score

In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the opj_j2k_setup_encoder function (openjp2/j2k.c). Remote attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file.

Record
CVE-2018-5785
Updated
2026-11-02
EUVDEUVD-2018-17552 No score

In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the opj_j2k_setup_encoder function (openjp2/j2k.c). Remote attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file.

Record
EUVD-2018-17552
Updated
2026-11-03
GitHub AdvisoriesGHSA-7pgc-fq24-w5rr 6.5

In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the...

In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the opj_j2k_setup_encoder function (openjp2/j2k.c). Remote attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file.

Record
GHSA-7pgc-fq24-w5rr
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-190
Updated
2026-11-02
OSVALPINE-CVE-2018-5785 6.5

In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the opj_j2k_setup_encoder function (openjp2/j2k.c). Remote attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file.

Record
ALPINE-CVE-2018-5785
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVBELL-CVE-2018-5785 6.5

CVE-2018-5785 does not affect BellSoft software

Record
BELL-CVE-2018-5785
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02
Show 10 moreShow less
OSV 6.5

In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the opj_j2k_setup_encoder function (openjp2/j2k.c). Remote attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file.

Record
CVE-2018-5785
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2018-5785 6.5

In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the opj_j2k_setup_encoder function (openjp2/j2k.c). Remote attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file.

Record
DEBIAN-CVE-2018-5785
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHSA-2021:4251 7.8

Red Hat Security Advisory: openjpeg2 security update

Record
RHSA-2021:4251
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVRLSA-2021:4251 7.8

Moderate: openjpeg2 security update

OpenJPEG is an open source library for reading and writing image files in JPEG2000 format.

The following packages have been upgraded to a later upstream version: openjpeg2 (2.4.0).

Security Fix(es):

  • openjpeg: use-after-free and double-free via a mix of valid and invalid files in a directory operated on by the decompressor (CVE-2020-15389)

  • openjpeg: heap-buffer-overflow in lib/openjp2/mqc.c could result in DoS (CVE-2020-27814)

  • openjpeg: heap-buffer-overflow write in opj_tcd_dc_level_shift_encode() (CVE-2020-27823)

  • openjpeg: heap-buffer-overflow in color.c may lead to DoS or arbitrary code execution (CVE-2021-3575)

  • openjpeg: integer overflow in opj_t1_encode_cblks in src/lib/openjp2/t1.c (CVE-2018-5727)

  • openjpeg: integer overflow in opj_j2k_setup_encoder function in openjp2/j2k.c (CVE-2018-5785)

  • openjpeg: division-by-zero in functions pi_next_pcrl, pi_next_cprl, and pi_next_rpcl in openmj2/pi.c (CVE-2018-20845)

  • openjpeg: integer overflow in function opj_get_encoding_parameters in openjp2/pi.c (CVE-2018-20847)

  • openjpeg: denial of service in function opj_t1_encode_cblks in openjp2/t1.c (CVE-2019-12973)

  • openjpeg: global-buffer-overflow read in opj_dwt_calc_explicit_stepsizes() (CVE-2020-27824)

  • openjpeg: null pointer dereference in opj_tgt_reset function in lib/openjp2/tgt.c (CVE-2020-27842)

  • openjpeg: out-of-bounds read in opj_t2_encode_packet function in openjp2/t2.c (CVE-2020-27843)

  • openjpeg: heap-based buffer overflow in functions opj_pi_next_rlcp, opj_pi_next_rpcl and opj_pi_next_lrcp in openjp2/pi.c (CVE-2020-27845)

  • openjpeg: out-of-bounds write due to an integer overflow in opj_compress.c (CVE-2021-29338)

For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.

Additional Changes:

For detailed information on changes in this release, see the Rocky Linux 8.5 Release Notes linked from the References section.

Record
RLSA-2021:4251
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2018-5785 6.5

In OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the opj_j2k_setup_encoder function (openjp2/j2k.c). Remote attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file.

Record
UBUNTU-CVE-2018-5785
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
CVSS 3.0
6.5 MediumCVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVALSA-2021:4251 No score

Moderate: openjpeg2 security update

OpenJPEG is an open source library for reading and writing image files in JPEG2000 format.

The following packages have been upgraded to a later upstream version: openjpeg2 (2.4.0).

Security Fix(es):

  • openjpeg: use-after-free and double-free via a mix of valid and invalid files in a directory operated on by the decompressor (CVE-2020-15389)

  • openjpeg: heap-buffer-overflow in lib/openjp2/mqc.c could result in DoS (CVE-2020-27814)

  • openjpeg: heap-buffer-overflow write in opj_tcd_dc_level_shift_encode() (CVE-2020-27823)

  • openjpeg: heap-buffer-overflow in color.c may lead to DoS or arbitrary code execution (CVE-2021-3575)

  • openjpeg: integer overflow in opj_t1_encode_cblks in src/lib/openjp2/t1.c (CVE-2018-5727)

  • openjpeg: integer overflow in opj_j2k_setup_encoder function in openjp2/j2k.c (CVE-2018-5785)

  • openjpeg: division-by-zero in functions pi_next_pcrl, pi_next_cprl, and pi_next_rpcl in openmj2/pi.c (CVE-2018-20845)

  • openjpeg: integer overflow in function opj_get_encoding_parameters in openjp2/pi.c (CVE-2018-20847)

  • openjpeg: denial of service in function opj_t1_encode_cblks in openjp2/t1.c (CVE-2019-12973)

  • openjpeg: global-buffer-overflow read in opj_dwt_calc_explicit_stepsizes() (CVE-2020-27824)

  • openjpeg: null pointer dereference in opj_tgt_reset function in lib/openjp2/tgt.c (CVE-2020-27842)

  • openjpeg: out-of-bounds read in opj_t2_encode_packet function in openjp2/t2.c (CVE-2020-27843)

  • openjpeg: heap-based buffer overflow in functions opj_pi_next_rlcp, opj_pi_next_rpcl and opj_pi_next_lrcp in openjp2/pi.c (CVE-2020-27845)

  • openjpeg: out-of-bounds write due to an integer overflow in opj_compress.c (CVE-2021-29338)

For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.

Additional Changes:

For detailed information on changes in this release, see the AlmaLinux Release Notes linked from the References section.

Record
ALSA-2021:4251
Updated
2026-11-02
OSVMGASA-2019-0004 No score

Updated openjpeg2 packages fix security vulnerabilities

A stack-based buffer overflow in the pgxtoimage function in jpwl/convert.c could crash the converter (CVE-2017-17479).

A stack-based buffer overflow in the pgxtovolume function in jp3d/convert.c could crash the converter (CVE-2017-17480).

A flaw was found in OpenJPEG 2.3.0, there is an integer overflow caused by an out-of-bounds left shift in the opj_j2k_setup_encoder function (openjp2/j2k.c). Remote attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file (CVE-2018-5785).

In OpenJPEG 2.3.0, there is excessive iteration in the opj_t1_encode_cblks function of openjp2/t1.c. Attackers could leverage this vulnerability to cause a denial of service via a crafted bmp file (CVE-2018-6616).

A flaw was found in OpenJPEG 2.3.0. A NULL pointer dereference for "red" in the imagetopnm function of jp2/convert.c (CVE-2018-18088).

Record
MGASA-2019-0004
Updated
2026-11-02
OSVopenSUSE-SU-2024:11120-1 No score

libopenjp2-7-2.4.0-1.4 on GA media

These are all security issues fixed in the libopenjp2-7-2.4.0-1.4 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:11120-1
Updated
2026-11-02
OSVSUSE-SU-2022:1252-1 No score

Security update for openjpeg2

This update for openjpeg2 fixes the following issues:

  • CVE-2018-5727: Fixed integer overflow vulnerability in theopj_t1_encode_cblks function (bsc#1076314).
  • CVE-2018-5785: Fixed integer overflow caused by an out-of-bounds leftshift in the opj_j2k_setup_encoder function (bsc#1076967).
  • CVE-2018-6616: Fixed excessive iteration in the opj_t1_encode_cblks function of openjp2/t1.c (bsc#1079845).
  • CVE-2018-14423: Fixed division-by-zero vulnerabilities in the functions pi_next_pcrl, pi_next_cprl,and pi_next_rpcl in lib/openjp3d/pi.c (bsc#1102016).
  • CVE-2018-16375: Fixed missing checks for header_info.height and header_info.width in the function pnmtoimage in bin/jpwl/convert.c (bsc#1106882).
  • CVE-2018-16376: Fixed heap-based buffer overflow function t2_encode_packet in lib/openmj2/t2.c (bsc#1106881).
  • CVE-2018-20845: Fixed division-by-zero in the functions pi_next_pcrl, pi_next_cprl, and pi_next_rpcl in openmj2/pi.ci (bsc#1140130).
  • CVE-2020-6851: Fixed heap-based buffer overflow in opj_t1_clbl_decode_processor (bsc#1160782).
  • CVE-2020-8112: Fixed heap-based buffer overflow in opj_t1_clbl_decode_processor in openjp2/t1.c (bsc#1162090).
  • CVE-2020-15389: Fixed use-after-free if t a mix of valid and invalid files in a directory operated on by the decompressor (bsc#1173578).
  • CVE-2020-27823: Fixed heap buffer over-write in opj_tcd_dc_level_shift_encode() (bsc#1180457).
  • CVE-2021-29338: Fixed integer overflow that allows remote attackers to crash the application (bsc#1184774).
  • CVE-2022-1122: Fixed segmentation fault in opj2_decompress due to uninitialized pointer (bsc#1197738).
Record
SUSE-SU-2022:1252-1
Updated
2026-11-02
OSVUSN-4109-1 No score

openjpeg2 vulnerabilities

It was discovered that OpenJPEG incorrectly handled certain PGX files. An attacker could possibly use this issue to cause a denial of service or possibly remote code execution. (CVE-2017-17480)

It was discovered that OpenJPEG incorrectly handled certain files. An attacker could possibly use this issue to cause a denial of service. (CVE-2018-14423)

It was discovered that OpenJPEG incorrectly handled certain PNM files. An attacker could possibly use this issue to cause a denial of service. (CVE-2018-18088)

It was discovered that OpenJPEG incorrectly handled certain BMP files. An attacker could possibly use this issue to cause a denial of service. (CVE-2018-5785, CVE-2018-6616)

Record
USN-4109-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
openjpeg
Alpine:v3.10
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.11
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.12
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.13
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.14
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.15
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.16
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.17
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.18
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.19
before 2.3.0-r3
2.3.0-r3
Show 55 moreShow less
Affected packages
PackageAffectedFixed
openjpeg
Alpine:v3.20
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.21
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.22
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.23
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.24
before 2.3.0-r3
2.3.0-r3
openjpeg
Alpine:v3.6
before 2.3.0-r2
2.3.0-r2
openjpeg
Alpine:v3.7
before 2.3.0-r2
2.3.0-r2
openjpeg
Alpine:v3.8
before 2.3.0-r2
2.3.0-r2
openjpeg
Alpine:v3.9
before 2.3.0-r3
2.3.0-r3
openjpeg2
AlmaLinux:8
before 2.4.0-4.el8
2.4.0-4.el8
openjpeg2-devel
AlmaLinux:8
before 2.4.0-4.el8
2.4.0-4.el8
openjpeg2-devel-docs
AlmaLinux:8
before 2.4.0-4.el8
2.4.0-4.el8
openjpeg2-tools
AlmaLinux:8
before 2.4.0-4.el8
2.4.0-4.el8
openjpeg2
Debian:12
before 2.3.0-2
2.3.0-2
openjpeg2
Debian:13
before 2.3.0-2
2.3.0-2
openjpeg2
Debian:14
before 2.3.0-2
2.3.0-2
openjpeg2
Debian:9
before 2.1.2-1.1+deb9u3, plus listed versions
2.1.2-1.12.1.2-1.1+deb9u12.1.2-1.1+deb9u2
2.1.2-1.1+deb9u3
openjpeg2
Mageia:6
before 2.2.0-1.3.mga6
2.2.0-1.3.mga6
openjpeg2
Red Hat:enterprise_linux:8::appstream
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2-debuginfo
Red Hat:enterprise_linux:8::appstream
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2-debugsource
Red Hat:enterprise_linux:8::appstream
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2-devel-docs
Red Hat:enterprise_linux:8::appstream
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2-tools
Red Hat:enterprise_linux:8::appstream
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2-tools-debuginfo
Red Hat:enterprise_linux:8::appstream
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2-debuginfo
Red Hat:enterprise_linux:8::crb
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2-debugsource
Red Hat:enterprise_linux:8::crb
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2-devel
Red Hat:enterprise_linux:8::crb
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2-tools
Red Hat:enterprise_linux:8::crb
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2-tools-debuginfo
Red Hat:enterprise_linux:8::crb
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2
Rocky Linux:8
before 0:2.4.0-4.el8
0:2.4.0-4.el8
openjpeg2
SUSE:Linux Enterprise Module for Basesystem 15 SP3
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise Module for Package Hub 15 SP3
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise High Performance Computing 15-ESPOS
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise High Performance Computing 15-LTSS
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise Real Time 15 SP2
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise Server 15-LTSS
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise Server 15 SP1-BCL
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise Server 15 SP1-LTSS
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise Server 15 SP2-BCL
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise Server 15 SP2-LTSS
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise Server for SAP Applications 15
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise Server for SAP Applications 15 SP1
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Linux Enterprise Server for SAP Applications 15 SP2
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Manager Proxy 4.1
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Manager Retail Branch Server 4.1
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Manager Server 4.1
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Enterprise Storage 6
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
SUSE:Enterprise Storage 7
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
openSUSE:Leap 15.3
before 2.3.0-150000.3.5.1
2.3.0-150000.3.5.1
openjpeg2
Ubuntu:16.04:LTS
before 2.1.2-1.1+deb9u3build0.16.04.1, plus listed versions
2.1.0-2.12.1.0-2.1ubuntu0.12.1.2-1.1+deb9u2build0.1
2.1.2-1.1+deb9u3build0.16.04.1
openjpeg2
Ubuntu:18.04:LTS
before 2.3.0-2build0.18.04.1, plus listed versions
2.2.0-12.3.0-1
2.3.0-2build0.18.04.1

History

History
WhenChangedSources
2026-11-03aliasesEUVD
2026-11-02createdCVE List, GitHub Advisories, NVD, OSV

References

Show 132 moreShow less
MoveEnter Open