CVE-2022-48281
Description
processCropSelections in tools/tiffcrop.c in LibTIFF through 4.5.0 has a heap-based buffer overflow (e.g., "WRITE of size 307203") via a crafted TIFF image.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
38- osv-coords36 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%20Micro%205.2pkg:rpm/opensuse/tiff&distro=openSUSE%20Leap%20Micro%205.3pkg:rpm/opensuse/tiff&distro=openSUSE%20Tumbleweedpkg:rpm/suse/tiff&distro=SUSE%20Enterprise%20Storage%206pkg:rpm/suse/tiff&distro=SUSE%20Enterprise%20Storage%207pkg:rpm/suse/tiff&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-ESPOSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg: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%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-BCLpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP4-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP1pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Manager%20Proxy%204.2pkg:rpm/suse/tiff&distro=SUSE%20Manager%20Retail%20Branch%20Server%204.2pkg:rpm/suse/tiff&distro=SUSE%20Manager%20Server%204.2pkg:rpm/suse/tiff&distro=SUSE%20OpenStack%20Cloud%209pkg:rpm/suse/tiff&distro=SUSE%20OpenStack%20Cloud%20Crowbar%209
< 4.4.0-8.el9_2+ 35 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.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.5.0-2.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-44.65.1
- (no CPE)range: < 4.0.9-44.65.1
- (no CPE)range: < 4.0.9-44.65.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-44.65.1
- (no CPE)range: < 4.0.9-44.65.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-44.65.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-150000.45.25.1
- (no CPE)range: < 4.0.9-44.65.1
- (no CPE)range: < 4.0.9-44.65.1
Patches
Vulnerability mechanics
Root cause
"Incorrect buffer size calculation in processCropSelections leads to a heap-buffer-overflow when memset writes beyond the allocated region."
Attack vector
An attacker supplies a crafted TIFF image that triggers the `-Z` (crop zones) and `-e divided` options in `tiffcrop`. The tool reads the malformed image, which produces numerous warnings about unknown tags and missing PhotometricInterpretation, but continues processing. When `processCropSelections` computes the crop buffer size, it underestimates the required space, leading to a heap-buffer-overflow of size 307203 during a `memset` operation [ref_id=1].
Affected code
The vulnerability resides in `processCropSelections` in `tools/tiffcrop.c` (line 7826 in the ASan report). The function allocates a 38403-byte buffer via `limitMalloc` (line 7803) and then writes 307203 bytes into it via `_TIFFmemset` (line 7826), causing a heap-buffer-overflow [ref_id=1].
What the fix does
The issue report does not include a patch. The advisory [ref_id=1] documents the crash and ASan output but does not provide a fix commit. Remediation would require correcting the buffer size calculation in `processCropSelections` so that the allocated region is large enough for the `memset` write, or adding validation to reject images that produce an invalid crop region size.
Preconditions
- inputThe attacker must provide a crafted TIFF file that triggers the oversized crop selection.
- inputThe victim must run `tiffcrop` with the `-Z` (crop zones) and `-e divided` flags on the malicious file.
Reproduction
Clone the libtiff repository, configure with `./configure CFLAGS='-fsanitize=address -g3'`, build, and run: `./tools/tiffcrop -Z 1:3,2:4 -e divided ./poc /dev/null`. The tool will crash with a SIGSEGV and ASan reports a heap-buffer-overflow of size 307203 in `processCropSelections` [ref_id=1].
Generated on May 26, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- security.gentoo.org/glsa/202305-31mitrevendor-advisory
- www.debian.org/security/2023/dsa-5333mitrevendor-advisory
- lists.debian.org/debian-lts-announce/2023/01/msg00037.htmlmitremailing-list
- gitlab.com/libtiff/libtiff/-/commit/d1b6b9c1b3cae2d9e37754506c1ad8f4f7b646b5mitre
- gitlab.com/libtiff/libtiff/-/issues/488mitre
- security.netapp.com/advisory/ntap-20230302-0004/mitre
News mentions
0No linked articles in our index yet.