Hide Forgot
While investigating CVE-2009-3293 (bug #524217) fixed in PHP 5.2.11, it was discovered that _gdGetColors() (in libgd/gd_gd.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.
MITRE's CVE-2009-3546 record: ------------------------------ The _gdGetColors function in gd_gd.c in PHP 5.2.11 and 5.3.0, and the GD Graphics Library 2.x, does not properly verify a certain colorsTotal structure member, which might allow remote attackers to conduct buffer overflow or buffer over-read attacks via a crafted GD file, a different vulnerability than CVE-2009-3293. NOTE: some of these details are obtained from third party information.
php-5.3.1-1.fc12,maniadrive-1.2-19.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/php-5.3.1-1.fc12,maniadrive-1.2-19.fc12
php-5.3.1-1.fc12, maniadrive-1.2-19.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
This issue has been addressed in following products: Red Hat Enterprise Linux 4 Red Hat Enterprise Linux 5 Via RHSA-2010:0003 https://rhn.redhat.com/errata/RHSA-2010-0003.html
This issue has been addressed in following products: Red Hat Enterprise Linux 5 Red Hat Enterprise Linux 4 Red Hat Enterprise Linux 3 Via RHSA-2010:0040 https://rhn.redhat.com/errata/RHSA-2010-0040.html
php-5.2.12-1.fc11, maniadrive-1.2-17.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.
As noted in a Debian bug report [1], plt-scheme has an embedded copy of GD that is vulnerable to this. I'm not sure if it's possible to make plt-scheme link to the system libgd or not (I would hope it is), but regardless this needs to be fixed. I verified that the _gdGetColors() function exists in both F12 and F13 by searching on binary symbols: $ ./rqp -z gdGetColors rqp 0.6 ($Id: rqp 395 2010-10-17 04:26:14Z vdanen $) Searching database records for substring match for symbols (gdGetColors) Results in Tag: f12_i386 ======================================== gd-2.0.35-9.fc12 (gd): _gdGetColors in /usr/lib/libgd.so.2.0.0 plt-scheme-4.1.2-3.fc12 (plt-scheme): _gdGetColors in /usr/lib/plt/collects/plot/compiled/native/i386-linux/libplplot.so Results in Tag: f12_x86_64 ======================================== gd-2.0.35-9.fc12 (gd): _gdGetColors in /usr/lib/libgd.so.2.0.0 gd-2.0.35-9.fc12 (gd): _gdGetColors in /usr/lib64/libgd.so.2.0.0 plt-scheme-4.1.2-3.fc12 (plt-scheme): _gdGetColors in /usr/lib64/plt/collects/plot/compiled/native/x86_64-linux/libplplot.so Similar results in F13 and I suspect F14 and rawhide as well. [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601525
Created gd tracking bugs for this issue Affects: fedora-all [bug 830745]