CVE-2022-3570
Description
Multiple heap buffer overflows in tiffcrop.c utility in libtiff library Version 4.4.0 allows attacker to trigger unsafe or out of bounds memory access via crafted TIFF image file which could result into application crash, potential information disclosure or any other context-dependent impact
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
39- osv-coords37 versionspkg:rpm/almalinux/libtiffpkg:rpm/almalinux/libtiff-develpkg:rpm/almalinux/libtiff-toolspkg:rpm/opensuse/tiff&distro=openSUSE%20Leap%2015.3pkg: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%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-ESPOSpkg: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-ESPOSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-ESPOSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-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%20SP3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP3pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP4pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-BCLpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-BCLpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%2015-LTSSpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015pkg: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%20Software%20Development%20Kit%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Manager%20Proxy%204.1pkg:rpm/suse/tiff&distro=SUSE%20Manager%20Retail%20Branch%20Server%204.1pkg:rpm/suse/tiff&distro=SUSE%20Manager%20Server%204.1
< 4.4.0-7.el9+ 36 more
- (no CPE)range: < 4.4.0-7.el9
- (no CPE)range: < 4.4.0-7.el9
- (no CPE)range: < 4.4.0-7.el9
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.5.0-1.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-44.62.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-44.62.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-44.62.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
- (no CPE)range: < 4.0.9-150000.45.22.1
Patches
Vulnerability mechanics
Root cause
"Insufficient buffer allocation in tiffcrop conversion subroutines — buffers were sized exactly to the image data, but certain conversion functions (e.g., extractContigSamples32bits) read or write a few bytes beyond the nominal image boundary, causing heap buffer overflows."
Attack vector
An attacker crafts a TIFF image file with dimensions and sample parameters that, when processed by tiffcrop, cause conversion subroutines to read or write up to 3 bytes past the end of an allocated buffer [ref_id=1]. The bug is triggered during tiffcrop operations such as tile/strip reading and writing (readContigTilesIntoBuffer, readSeparateTilesIntoBuffer, writeBufferToSeparateStrips, writeBufferToContigTiles, writeBufferToSeparateTiles, readSeparateStripsIntoBuffer) [ref_id=1]. No authentication or special privileges are required — the attacker only needs to deliver the crafted TIFF file to a victim or service that invokes tiffcrop on it.
Affected code
The vulnerable code is in tiffcrop.c within the libtiff library (version 4.4.0). The affected functions include readContigTilesIntoBuffer, readSeparateTilesIntoBuffer, writeBufferToSeparateStrips, writeBufferToContigTiles, writeBufferToSeparateTiles, and readSeparateStripsIntoBuffer [ref_id=1]. All of these allocate internal buffers without the extra 3 bytes needed by conversion subroutines like extractContigSamples32bits [ref_id=1].
What the fix does
The patch introduces a constant NUM_BUFF_OVERSIZE_BYTES (value 3) and adds that many extra bytes to every buffer allocation in the affected subroutines [ref_id=1]. For example, limitMalloc(tile_buffsize) becomes limitMalloc(tile_buffsize + NUM_BUFF_OVERSIZE_BYTES), and memset calls are extended to cover the larger buffer [ref_id=1]. The commit also adds an assert(NUM_BUFF_OVERSIZE_BYTES >= 3) at the start of main() to enforce the safety margin at runtime [ref_id=1]. These changes ensure that the conversion subroutines have room for the extra bytes they write without corrupting adjacent heap memory.
Preconditions
- inputAttacker must supply a crafted TIFF image file that triggers tiffcrop conversion operations.
- networkThe crafted TIFF must be processed by a victim or service running tiffcrop (local or remote delivery).
Generated on May 26, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- www.debian.org/security/2023/dsa-5333mitrevendor-advisory
- lists.debian.org/debian-lts-announce/2023/01/msg00018.htmlmitremailing-list
- gitlab.com/gitlab-org/cves/-/blob/master/2022/CVE-2022-3570.jsonmitre
- gitlab.com/libtiff/libtiff/-/commit/bd94a9b383d8755a27b5a1bc27660b8ad10b094cmitre
- gitlab.com/libtiff/libtiff/-/issues/381mitre
- gitlab.com/libtiff/libtiff/-/issues/386mitre
- security.netapp.com/advisory/ntap-20230203-0002/mitre
News mentions
0No linked articles in our index yet.