CVE-2020-12268
Description
Heap buffer overflow in jbig2dec before 0.18 in jbig2_image_compose, triggered by crafted PDF/images, leading to potential memory corruption.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Heap buffer overflow in jbig2dec before 0.18 in jbig2_image_compose, triggered by crafted PDF/images, leading to potential memory corruption.
Vulnerability
A heap-based buffer overflow exists in the function jbig2_image_compose in jbig2_image.c of Artifex jbig2dec versions before 0.18. The issue occurs when composing a source image onto a destination image at an offset (x, y); missing integer overflow checks allow crafted input values to bypass size validation, resulting in an undersized buffer allocation and subsequent out-of-bounds write on the heap.
Exploitation
An attacker with the ability to supply a malicious JBIG2-encoded image (e.g., via a PDF or standalone image file) can exploit this vulnerability without authentication or user interaction beyond opening the crafted file. The input must specify extreme x and y offset values such that the arithmetic overflow of width and height calculations goes undetected. No special network position or privileges are required; the malicious file can be delivered via email, web download, or any other vector that leads to processing by a vulnerable jbig2dec instance.
Impact
Successful exploitation leads to a heap buffer overflow, likely corrupting adjacent memory. This can result in denial of service, or potentially arbitrary code execution in the context of the application using jbig2dec. The impact depends on the heap layout and the ability of the attacker to control the overflow data; at minimum, affected applications may crash. The vulnerability affects all uses of jbig2dec through image parsing in Ghostscript, PDF viewers, and other tools that rely on this library.
Mitigation
The vulnerability is fixed in jbig2dec version 0.18. The fix, introduced in commit 0726320 [1][2], adds a check to validate that src->width and src->height do not overflow when combined with the offset values. Users should update to jbig2dec 0.18 or later; if immediate update is not possible, ensure that only trusted JBIG2 data is processed. The vulnerability is not listed on CISA's Known Exploited Vulnerabilities catalog as of the publication date.
AI Insight generated on May 27, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
54- Artifex/jbig2decdescription
- osv-coords52 versionspkg:rpm/opensuse/ghostscript&distro=openSUSE%20Leap%2015.1pkg:rpm/opensuse/ghostscript&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/ghostscript-mini&distro=openSUSE%20Leap%2015.1pkg:rpm/opensuse/libspectre&distro=openSUSE%20Leap%2015.1pkg:rpm/suse/ghostscript&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/ghostscript&distro=SUSE%20Enterprise%20Storage%205pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-ESPOSpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-LTSSpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP1pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP1-LTSSpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-BCLpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-LTSSpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3-BCLpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3-LTSSpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP4pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2015-LTSSpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP1pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP2pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP3pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP4pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP4pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5pkg:rpm/suse/ghostscript&distro=SUSE%20OpenStack%20Cloud%207pkg:rpm/suse/ghostscript&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/ghostscript&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/libspectre&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/libspectre&distro=SUSE%20Enterprise%20Storage%205pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-ESPOSpkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-LTSSpkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP1pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP1-LTSSpkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-BCLpkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-LTSSpkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3-BCLpkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3-LTSSpkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP4pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%2015-LTSSpkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP1pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP2pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP3pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP4pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP4pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5pkg:rpm/suse/libspectre&distro=SUSE%20OpenStack%20Cloud%207pkg:rpm/suse/libspectre&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/libspectre&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208
< 9.52-lp151.3.12.1+ 51 more
- (no CPE)range: < 9.52-lp151.3.12.1
- (no CPE)range: < 9.54.0-2.2
- (no CPE)range: < 9.52-lp151.3.12.1
- (no CPE)range: < 0.2.8-lp151.3.3.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-3.27.2
- (no CPE)range: < 9.52-3.27.2
- (no CPE)range: < 9.52-3.27.2
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-3.27.2
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-3.27.2
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 9.52-23.34.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.8-3.10.1
- (no CPE)range: < 0.2.8-3.10.1
- (no CPE)range: < 0.2.8-3.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.8-3.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.8-3.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
- (no CPE)range: < 0.2.7-12.10.1
Patches
0No patches discovered yet.
Vulnerability mechanics
Root cause
"Missing integer overflow validation in jbig2_image_compose allows arithmetic overflow leading to heap buffer overflow."
Attack vector
An attacker provides a crafted JBIG2 image where the `src->width`, `src->height`, and offset coordinates (x, y) are chosen such that the arithmetic `src->width + x` or `src->height + y` overflows a 32-bit unsigned integer [ref_id=1]. This overflow bypasses subsequent bounds checks, leading to a heap-based buffer overflow when the function writes pixel data into the destination bitmap beyond its allocated memory.
Affected code
The vulnerability is in the `jbig2_image_compose` function in `jbig2_image.c` [ref_id=1]. The function lacked integer overflow checks when computing buffer offsets for composing a source image onto a destination image at coordinates (x, y).
What the fix does
The patch adds a pre-computation overflow check before any buffer operations [ref_id=1]. It verifies that `UINT32_MAX - src->width` is not less than the absolute value of `x`, and similarly for `src->height` and `y`. If an overflow would occur, the function returns 0 early, preventing the heap buffer overflow. This closes the vulnerability by ensuring all arithmetic on image dimensions is validated before use.
Preconditions
- inputAttacker must supply a crafted JBIG2 image with dimensions and offsets that cause integer overflow in jbig2_image_compose
- configThe vulnerable jbig2dec version must be before 0.18
Generated on May 31, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- lists.opensuse.org/opensuse-security-announce/2020-05/msg00034.htmlmitrevendor-advisoryx_refsource_SUSE
- bugs.chromium.org/p/oss-fuzz/issues/detailmitrex_refsource_MISC
- github.com/ArtifexSoftware/jbig2dec/commit/0726320a4b55078e9d8deb590e477d598b3da66emitrex_refsource_MISC
- github.com/ArtifexSoftware/jbig2dec/compare/0.17...0.18mitrex_refsource_MISC
- lists.debian.org/debian-lts-announce/2021/10/msg00023.htmlmitremailing-listx_refsource_MLIST
News mentions
0No linked articles in our index yet.