VYPR
Unrated severityNVD Advisory· Published Jun 4, 2012· Updated Apr 29, 2026

CVE-2012-1173

CVE-2012-1173

Description

Multiple integer overflows in tiff_getimage.c in LibTIFF 3.9.4 allow remote attackers to execute arbitrary code via a crafted tile size in a TIFF file, which is not properly handled by the (1) gtTileSeparate or (2) gtStripSeparate function, leading to a heap-based buffer overflow.

AI Insight

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

Affected products

3

Patches

Vulnerability mechanics

Root cause

"Integer overflow in tile/strip size multiplication in tif_getimage.c leads to undersized heap allocation and buffer overflow."

Attack vector

An attacker crafts a TIFF file with a malicious tile size (or strip size) that, when multiplied by 3 or 4 inside `gtTileSeparate` or `gtStripSeparate`, causes an integer overflow. The overflowed value is passed to `_TIFFmalloc`, allocating an undersized heap buffer, and subsequent writes overflow that buffer, leading to arbitrary code execution. The attack is delivered over the network by tricking a user or service into processing the malformed TIFF file. [ref_id=1]

What the fix does

The patch replaces the direct multiplication `(alpha?4:3)*tilesize` (and the analogous `stripsize` expression) with a call to `TIFFSafeMultiply`, which checks for overflow before performing the multiplication. If overflow is detected, `bufsize` is set to 0, the allocation is skipped, and an error is returned instead of proceeding with a corrupted size. The same safe-multiply result is also used for the subsequent `_TIFFmemset` call, ensuring the memset operates on the correctly computed buffer size. [ref_id=1]

Preconditions

  • inputThe attacker must supply a TIFF file with a crafted tile or strip size that triggers an integer overflow when multiplied by 3 or 4.
  • inputThe victim must open the malicious TIFF file with a vulnerable version of LibTIFF (3.9.4).

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

References

27

News mentions

0

No linked articles in our index yet.