VYPR
Unrated severityNVD Advisory· Published Jun 30, 2022· Updated Aug 3, 2024

CVE-2022-2056

CVE-2022-2056

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

Patches

Vulnerability mechanics

Root cause

"Missing division-by-zero check in `computeOutputPixelOffsets` allows a crafted TIFF to cause a floating-point exception."

Attack vector

An attacker crafts a malicious TIFF file that, when processed by `tiffcrop` with specific command-line flags (`-R 270 -O auto -P 300.0x300.0`), causes a floating-point exception (FPE) in `computeOutputPixelOffsets` [ref_id=1]. The attacker does not need authentication; they only need to deliver the crafted file to a victim who runs `tiffcrop` on it. The crash results in a denial-of-service condition.

Affected code

The vulnerability resides in `tools/tiffcrop.c` at line 5817-5818, within the function `computeOutputPixelOffsets`. The issue is triggered when `tiffcrop` is invoked with the `-R 270` (rotation) and `-P 300.0x300.0` (page width/height) options on a crafted TIFF file [ref_id=1].

What the fix does

The fix is available in commit `f3a5e010` of the libtiff repository. While the exact diff is not shown in the advisory, the commit addresses the divide-by-zero condition in `computeOutputPixelOffsets` at `tools/tiffcrop.c:5817` by adding a check to prevent division by zero when computing pixel offsets [ref_id=1]. Users compiling from source should apply this commit to eliminate the FPE.

Preconditions

  • inputVictim must run tiffcrop with the -R (rotation) and -P (page dimensions) flags on the attacker-supplied file
  • inputThe crafted TIFF file must trigger a zero divisor in computeOutputPixelOffsets

Reproduction

1. 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` [ref_id=1]. 2. Obtain the crafted PoC TIFF file from the issue attachment. 3. Run: `./build_asan/bin/tiffcrop -R 270 -O auto -P 300.0x300.0 poc /tmp/foo` [ref_id=1]. 4. Observe the FPE crash at `computeOutputPixelOffsets` in `tiffcrop.c:5818`.

Generated on May 24, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

8

News mentions

0

No linked articles in our index yet.