REDHAT-BUG-2554464: Buffer Overflow
GIMP ships a plug-in (file-pvr) that loads textures stored in the PowerVR (.pvr) texture format. Inside pvrdecodecompressed (the helper used for the four compressed-VQ data formats), the size of the destination pixel buffer is computed in 32-bit int arithmetic from the file's declared width, height, and a derived component count. For attacker-chosen 16-bit dimension pairs (e.g. width = 32 768, height = 32 769) and an alpha-bearing pixel mode (MODEARGB1555 or MODEARGB4444), the product width × height × ncomponents overflows INTMAX and wraps to a small positive value — 131 072 bytes for the demonstrated trigger. The function allocates that much memory and then writes into it using the original (large) width × ncomponents row stride, producing a heap-based buffer overflow write at the very first row past the allocated boundary. The dispatcher in loadimage does perform a bounds check (mipmapwidth >= MAXTWIDDLESIZE and mipmapheight >= MAXTWIDDLESIZE), but for dataformat == MODECOMPRESSEDMIPMAP (or MODESMALLVQMIPMAP) that check applies only to the auto-derived mipmap dimensions, not to the file's width/height values that are passed unchecked into pvrdecodecompressed. This is the gap that makes the integer overflow reachable. Triggering the vulnerability requires only that the user open or thumbnail a crafted .pvr file in GIMP — for example by double-clicking the file, dragging it into GIMP, or via any indexer that invokes GIMP's file-thumbnailer backend. The bug is a heap write (CWE-787) of attacker-influenced bytes off the end of an undersized buffer; the writes are short (1 byte at a time per component) but their starting offset and surrounding contents are derived from data that the attacker fully controls (the codebook bytes in the PVR file). This makes the bug a strong candidate for heap corruption / arbitrary write primitive that may be developed into remote code execution. At minimum it provides reliable denial-of-service via plug-in crash.
Affected Software
Event History
Frequently Asked Questions
What must an attacker provide to trigger the overflow?
An attacker needs to cause GIMP to load a crafted PowerVR (.pvr) texture using the file-pvr plug-in. The file must declare attacker-controlled 16-bit width and height values that overflow the 32-bit destination-buffer size calculation, together with an alpha-bearing pixel mode such as MODE_ARGB1555 or MODE_ARGB4444.
Are compressed mipmap PVR files subject to the existing dimension check?
Not reliably. For MODE_COMPRESSED_MIPMAP and MODE_SMALL_VQ_MIPMAP, the dispatcher checks auto-derived mipmap dimensions rather than the file width and height passed to pvr_decode_compressed, leaving the relevant declared dimensions unchecked.
How can I identify potentially affected input files?
Inspect PVR files before loading them for unusually large declared 16-bit dimensions, particularly dimension pairs whose width × height × component count can exceed INT_MAX. Alpha-bearing modes and compressed-VQ formats are specifically implicated.