CVE-2023-0800
Description
LibTIFF 4.4.0 has an out-of-bounds write in tiffcrop in tools/tiffcrop.c:3502, allowing attackers to cause a denial-of-service via a crafted tiff file. For users that compile libtiff from sources, the fix is available with commit 33aee127.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
20- osv-coords18 versionspkg:rpm/almalinux/libtiffpkg:rpm/almalinux/libtiff-develpkg:rpm/almalinux/libtiff-toolspkg:rpm/opensuse/tiff&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/tiff&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/tiff&distro=openSUSE%20Leap%20Micro%205.3pkg:rpm/opensuse/tiff&distro=openSUSE%20Tumbleweedpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Micro%205.2pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Micro%205.3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Micro%205.4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5
< 4.4.0-8.el9_2+ 17 more
- (no CPE)range: < 4.4.0-8.el9_2
- (no CPE)range: < 4.4.0-8.el9_2
- (no CPE)range: < 4.4.0-8.el9_2
- (no CPE)range: < 4.0.9-150000.45.28.1
- (no CPE)range: < 4.0.9-150000.45.28.1
- (no CPE)range: < 4.0.9-150000.45.28.1
- (no CPE)range: < 4.5.0-3.1
- (no CPE)range: < 4.0.9-150000.45.28.1
- (no CPE)range: < 4.0.9-150000.45.28.1
- (no CPE)range: < 4.0.9-150000.45.28.1
- (no CPE)range: < 4.0.9-150000.45.28.1
- (no CPE)range: < 4.0.9-150000.45.28.1
- (no CPE)range: < 4.0.9-150000.45.28.1
- (no CPE)range: < 4.0.9-150000.45.28.1
- (no CPE)range: < 4.0.9-150000.45.28.1
- (no CPE)range: < 4.0.9-44.68.1
- (no CPE)range: < 4.0.9-44.68.1
- (no CPE)range: < 4.0.9-44.68.1
Patches
Vulnerability mechanics
Root cause
"Missing validation that composite regions have equal dimensions before copying pixel data, leading to an out-of-bounds write in extractContigSamplesShifted16bits."
Attack vector
An attacker crafts a TIFF file with multiple crop regions of unequal width or length and invokes tiffcrop with the `-E` (edge) composite option, e.g. `-E right -z 1,1,2048,2048:1,2049,2048,4097` [ref_id=2]. The tool computes buffer sizes based on the first region's dimensions but then writes pixel data from a larger region, causing a heap-buffer-overflow at `tools/tiffcrop.c:3502` in `extractContigSamplesShifted16bits` [ref_id=2]. No authentication is required; the attack is delivered via a local crafted TIFF file.
Affected code
The out-of-bounds write occurs in `extractContigSamplesShifted16bits` at `tools/tiffcrop.c:3502` [ref_id=2]. The root cause is in `extractCompositeRegions` (around line 6801) and `computeInputPixelOffsets` (around line 5935), which lacked validation that composite regions have equal dimensions [ref_id=1].
What the fix does
The patch [ref_id=1] adds validation checks in `computeInputPixelOffsets` and `extractCompositeRegions` to ensure that when `crop->img_mode == COMPOSITE_IMAGES`, all regions have equal length (for EDGE_LEFT/EDGE_RIGHT) or equal width (for EDGE_TOP/EDGE_BOTTOM) before proceeding. If the dimensions mismatch, the functions return an error instead of allowing the out-of-bounds copy. The fix also corrects a comparison in the existing check at lines 7387 and 7481 to compare against the next region rather than the previous one.
Preconditions
- inputAttacker must provide a crafted TIFF file with crop regions of unequal dimensions
- configtiffcrop must be invoked with composite edge option (-E left/right/top/bottom) and multiple -z regions
Reproduction
Build libtiff with AddressSanitizer: `CFLAGS="-g -fsanitize=address -fno-omit-frame-pointer" CXXFLAGS="-g -fsanitize=address -fno-omit-frame-pointer" ./configure --prefix=$PWD/build_asan --disable-shared && make -j && make install`. Then run: `./build_asan/bin/tiffcrop -E right -z 1,1,2048,2048:1,2049,2048,4097 poc /tmp/foo` using the provided poc.zip [ref_id=2].
Generated on May 26, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- security.gentoo.org/glsa/202305-31mitrevendor-advisory
- www.debian.org/security/2023/dsa-5361mitrevendor-advisory
- lists.debian.org/debian-lts-announce/2023/02/msg00026.htmlmitremailing-list
- gitlab.com/gitlab-org/cves/-/blob/master/2023/CVE-2023-0800.jsonmitre
- gitlab.com/libtiff/libtiff/-/commit/33aee1275d9d1384791d2206776eb8152d397f00mitre
- gitlab.com/libtiff/libtiff/-/issues/496mitre
- security.netapp.com/advisory/ntap-20230316-0002/mitre
News mentions
0No linked articles in our index yet.