CVE-2022-2057
Description
Divide By Zero error in tiffcrop in libtiff 4.4.0 allows 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 f3a5e010.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
18- osv-coords16 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%20Tumbleweedpkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Micro%205.2pkg: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%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/tiff&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP5
< 4.0.9-26.el8_7+ 15 more
- (no CPE)range: < 4.0.9-26.el8_7
- (no CPE)range: < 4.0.9-26.el8_7
- (no CPE)range: < 4.0.9-26.el8_7
- (no CPE)range: < 4.0.9-150000.45.11.1
- (no CPE)range: < 4.0.9-150000.45.11.1
- (no CPE)range: < 4.0.9-150000.45.11.1
- (no CPE)range: < 4.4.0-2.1
- (no CPE)range: < 4.0.9-150000.45.11.1
- (no CPE)range: < 4.0.9-150000.45.11.1
- (no CPE)range: < 4.0.9-150000.45.11.1
- (no CPE)range: < 4.0.9-150000.45.11.1
- (no CPE)range: < 4.0.9-150000.45.11.1
- (no CPE)range: < 4.0.9-150000.45.11.1
- (no CPE)range: < 4.0.9-44.51.1
- (no CPE)range: < 4.0.9-44.51.1
- (no CPE)range: < 4.0.9-44.51.1
Patches
Vulnerability mechanics
Root cause
"Missing division-by-zero check in `computeOutputPixelOffsets` allows a crafted TIFF file to cause a floating-point exception."
Attack vector
An attacker provides a crafted TIFF file that, when processed by `tiffcrop` with options such as `-R 270 -P 300.0x300.0`, triggers a divide-by-zero (floating-point exception) in `computeOutputPixelOffsets` [ref_id=1]. The crafted file contains numerous malformed or missing TIFF tags (e.g., invalid tag ordering, missing required fields like `StripByteCounts` and `PhotometricInterpretation`), which cause the function to compute pixel offsets using a zero divisor. The attack requires no authentication and is delivered over the network by inducing a user or automated service to run `tiffcrop` on the malicious file.
Affected code
The vulnerability is a floating-point exception (FPE) in the function `computeOutputPixelOffsets` at line 5936 of `tools/tiffcrop.c` [ref_id=1]. The crash occurs when `tiffcrop` processes a crafted TIFF file with specific command-line arguments (`-R 270 -P 300.0x300.0`).
What the fix does
The fix is available with commit `f3a5e010` in the libtiff repository [ref_id=1]. The patch adds a check to ensure the divisor used in `computeOutputPixelOffsets` is non-zero before performing the division, preventing the floating-point exception. Without this fix, a crafted TIFF file with malformed or missing tags causes a division by zero, leading to a denial-of-service crash.
Preconditions
- inputThe attacker must supply a crafted TIFF file that triggers the divide-by-zero condition.
- inputThe victim must run tiffcrop with specific command-line options (e.g., -R 270 -P 300.0x300.0) on the malicious file.
Reproduction
1. Compile libtiff with debug symbols: `CFLAGS="-g -O0" CXXFLAGS="-g -O0" ./configure --prefix=$PWD/build_orig --disable-shared && make -j && make install` [ref_id=1]. 2. Run `./build_orig/bin/tiffcrop -R 270 -P 300.0x300.0 poc /tmp/foo` on the provided PoC file [ref_id=1]. 3. Observe the floating-point exception (core dump) at `tiffcrop.c:5936` in `computeOutputPixelOffsets` [ref_id=1].
Generated on May 24, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4TSS7MJ7OO7JO5BNKCRYSFU7UAYOKLA2/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OXUMJXVEAYFWRO3U3YHKSULHIVDOLEQS/mitrevendor-advisory
- 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-2057.jsonmitre
- gitlab.com/libtiff/libtiff/-/issues/427mitre
- gitlab.com/libtiff/libtiff/-/merge_requests/346mitre
- security.netapp.com/advisory/ntap-20220826-0001/mitre
News mentions
0No linked articles in our index yet.