CVE-2025-9900: Libtiff: libtiff write-what-where
A flaw was found in Libtiff. This vulnerability is a "write-what-where" condition, triggered when the library processes a specially crafted TIFF image file.
Other sources
Write-What-Where in libtiff via TIFFReadRGBAImageOriented
The vulnerability resides in the raster decoding logic of libtiff, specifically when processing paletted (indexed color) images with malformed metadata. The function TIFFReadRGBAImageOriented() computes a pointer offset into the raster buffer based on user-controlled image metadata:
raster + (rheight - img.height) rwidth
If the attacker supplies a very large value for img.height (e.g., 0xFFFF) and a valid rheight (e.g., 256), this computation results in a large positive offset, causing the raster pointer (cp) passed into functions like put8bitcmaptile() or put1bitbwtile() to point beyond the bounds of the allocated buffer.
Inside those functions, memory writes occur like this:
cp++ = PALmap[pp][0];
• The write address (cp) is attacker-controlled via the offset calculation from img.height. • The value written (PALmap[pp][0]) is also attacker-controlled: ◦ pp is dereferenced from pixel data in the image file. ◦ PALmap is constructed from the image's color palette, which the attacker also controls. This constitutes a write-what-where vulnerability with a attacker control. Exploitation of a write-what-where primitive can lead to denial of service or code execution through supply of maliciously crafted files.
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/tiffto a version that resolves this vulnerability.Fixed in 4.2.0-1+deb11u8Fixed in 4.5.0-6+deb12u4Fixed in 4.7.0-3+deb13u2Fixed in 4.7.1-2
Event History
Frequently Asked Questions
What is the severity of CVE-2025-9900?
CVE-2025-9900 is classified as a critical vulnerability due to its potential to allow arbitrary code execution.
How do I fix CVE-2025-9900?
To fix CVE-2025-9900, update to Libtiff version 4.2.0-1+deb11u7 or 4.7.1-1.
What software is affected by CVE-2025-9900?
CVE-2025-9900 affects the Libtiff library and specifically versions prior to 4.2.0-1+deb11u7 and 4.7.1-1.
What type of vulnerability is CVE-2025-9900?
CVE-2025-9900 is a write-what-where condition that occurs when processing specially crafted TIFF image files.
Can CVE-2025-9900 be exploited remotely?
Yes, CVE-2025-9900 can be exploited remotely through malicious TIFF files.