REDHAT-BUG-529213: Low severity Red Hat gd vulnerability
While investigating CVE-2009-3293 (bug #524217) fixed in PHP 5.2.11, it was discovered that gdGetColors() (in libgd/gdgd.c) does not properly check values read from the input GD file, making it possible to set im->colorsTotal to a value greater than gdMaxColors. GD code assumes that colorsTotal is always less than or equal to gdMaxColors, as it is used as an upper bound when accessing arrays with gdMaxColors size. Higher colorsTotal value can lead to buffer over-reads or over-writes on multiple places.
Issue was reported and fixed upstream: http://svn.php.net/viewvc?view=revision&revision=289557
Fix should get include in the future PHP and GD versions.
Note: GD image format is not meant for general purpose use and should not be used to distribute images. Its purpose is to allow fast loading by applications using libGD: http://www.libgd.org/GdFileFormats
This affects gd in Red Hat Enterprise Linux 4 and 5, version in Red Hat Enterprise Linux 3 is not affected.
It also affects all current PHP versions (Red Hat Enterprise Linux 3, 4 and 5, Fedora), as they include embedded copy of gd 2.x.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 5.2.11