VYPR
Unrated severityNVD Advisory· Published Mar 28, 2022· Updated Aug 2, 2024

CVE-2022-1056

CVE-2022-1056

Description

Out-of-bounds Read error in tiffcrop in libtiff 4.3.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 46dc8fcd.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

33

Patches

Vulnerability mechanics

Root cause

"Missing bounds check in extractImageSection causes _TIFFmemcpy to read beyond the allocated heap buffer when processing a crafted TIFF file."

Attack vector

An attacker supplies a crafted TIFF file that, when processed by `tiffcrop` with the `-H` crop-height option (e.g. `tiffcrop -H 341 poc /tmp/foo`), triggers a heap-buffer-overflow read in `_TIFFmemcpy` [ref_id=1]. The malformed file contains numerous invalid or warning-inducing tags (e.g. unknown tags, mismatched color channels, and Fax4 decode errors) that cause `loadImage` to allocate a buffer of insufficient size for the subsequent `extractImageSection` copy operation [ref_id=1]. No authentication or special network access is required; the attacker only needs to deliver the crafted file to a victim running `tiffcrop`.

Affected code

The out-of-bounds read occurs in `_TIFFmemcpy` at `libtiff/tif_unix.c:346`, called from `extractImageSection` in `tools/tiffcrop.c:6854`, which is invoked by `writeImageSections` at `tools/tiffcrop.c:7103` and ultimately from `main` at `tools/tiffcrop.c:2451` [ref_id=1]. The heap buffer was allocated via `_TIFFmalloc` in `loadImage` at `tools/tiffcrop.c:6210` [ref_id=1].

What the fix does

The fix is available in commit `46dc8fcd` [per the CVE description]. The advisory does not include the patch diff, but the issue report [ref_id=1] identifies the root cause as a heap-buffer-overflow in `_TIFFmemcpy` during `extractImageSection`. The remediation ensures that the copy size passed to `_TIFFmemcpy` does not exceed the allocated buffer bounds, preventing the out-of-bounds read that leads to a denial-of-service.

Preconditions

  • inputVictim must run tiffcrop on the attacker-supplied file
  • inputThe crafted TIFF file must trigger the specific code path in extractImageSection

Reproduction

Build libtiff with AddressSanitizer (`-fsanitize=address`), then run: `./build_asan/bin/tiffcrop -H 341 poc /tmp/foo` using the proof-of-concept file linked in the issue [ref_id=1]. The tool will output numerous TIFF warnings and then crash with a heap-buffer-overflow in `_TIFFmemcpy` [ref_id=1].

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

References

5

News mentions

0

No linked articles in our index yet.