CVE-2023-0801
Description
LibTIFF 4.4.0 has an out-of-bounds write in tiffcrop in libtiff/tif_unix.c:368, invoked by tools/tiffcrop.c:2903 and tools/tiffcrop.c:6778, 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-image regions have equal dimensions allows an out-of-bounds write in _TIFFmemcpy."
Attack vector
An attacker crafts a TIFF file with multiple crop regions of unequal width or length and invokes tiffcrop with the `-E` composite flag (e.g., `-E right -z 1,1,2048,2048:1,2049,2048,4097`). The `extractCompositeRegions` function at `tools/tiffcrop.c:6778` passes mismatched region dimensions to `extractContigSamplesBytes` at `tools/tiffcrop.c:2903`, which calls `_TIFFmemcpy` at `libtiff/tif_unix.c:368` with a computed buffer size that exceeds the allocated heap buffer, causing a heap-buffer-overflow write [ref_id=2]. No authentication is required; the attack is triggered by processing a malicious file.
Affected code
The vulnerable code paths are in `tools/tiffcrop.c`: `extractCompositeRegions` (line 6778) calls `extractContigSamplesBytes` (line 2903), which performs the out-of-bounds `_TIFFmemcpy` in `libtiff/tif_unix.c:368` [ref_id=2]. The patch modifies `computeInputPixelOffsets` and `extractCompositeRegions` in the same file [ref_id=1].
What the fix does
The patch [ref_id=1] adds two validation checks. In `computeInputPixelOffsets`, it verifies that when `EDGE_LEFT` or `EDGE_RIGHT` is used, all regions have equal `zlength`, and when `EDGE_TOP` or `EDGE_BOTTOM` is used, all regions have equal `zwidth`, returning -1 on mismatch. In `extractCompositeRegions`, it adds a pre-loop that checks all region widths (for top/bottom) or lengths (for left/right) are equal before proceeding, and corrects the adjacent-region comparison from checking `i-1` to checking `i+1` to avoid off-by-one logic errors. These changes ensure composite operations only proceed when region dimensions are consistent, preventing the buffer overrun.
Preconditions
- inputAttacker must supply a crafted TIFF file with multiple crop regions of unequal dimensions.
- configThe tiffcrop tool must be invoked with the -E composite flag (e.g., -E right) and -z region specification.
Reproduction
Build libtiff with AddressSanitizer (`-fsanitize=address`), then run: `./build_asan/bin/tiffcrop -E right -z 1,1,2048,2048:1,2049,2048,4097 -i poc /tmp/foo` using the attached `poc.zip` file [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-0801.jsonmitre
- gitlab.com/libtiff/libtiff/-/commit/33aee1275d9d1384791d2206776eb8152d397f00mitre
- gitlab.com/libtiff/libtiff/-/issues/498mitre
- security.netapp.com/advisory/ntap-20230316-0002/mitre
News mentions
0No linked articles in our index yet.