Bug 1351069 (CVE-2016-5767) - CVE-2016-5767 gd: Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
Summary: CVE-2016-5767 gd: Integer Overflow in gdImagePaletteToTrueColor() resulting i...
Status: NEW
Alias: CVE-2016-5767
Product: Security Response
Classification: Other
Component: vulnerability   
(Show other bugs)
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact: Huzaifa S. Sidhpurwala
URL:
Whiteboard: impact=moderate,public=20160623,repor...
Keywords: Security
Depends On: 1351180 1356812 1356813
Blocks: 1323912 1351183
TreeView+ depends on / blocked
 
Reported: 2016-06-29 07:19 UTC by Andrej Nemec
Modified: 2018-06-29 22:12 UTC (History)
12 users (show)

Fixed In Version: php 5.5.37, php 5.6.23
Doc Type: If docs needed, set a value
Doc Text:
An integer overflow flaw, leading to a heap-based buffer overflow was found in the gdImagePaletteToTrueColor() function of PHP's gd extension. A remote attacker could use this flaw to crash a PHP application or execute arbitrary code with the privileges of the user running that PHP application using gd via a specially crafted image buffer.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2598 normal SHIPPED_LIVE Moderate: php security and bug fix update 2016-11-03 12:12:00 UTC
Red Hat Product Errata RHSA-2016:2750 normal SHIPPED_LIVE Moderate: rh-php56 security, bug fix, and enhancement update 2016-11-15 16:40:02 UTC

Description Andrej Nemec 2016-06-29 07:19:53 UTC
The gdImagePaletteToTrueColor() is prone to an integer overflow, which result in heap based overflow.

Upstream bug:

https://bugs.php.net/bug.php?id=72446

Upstream patch:

http://git.php.net/?p=php-src.git;a=commitdiff;h=c395c6e5d7e8df37a21265ff76e48fe75ceb5ae6

CVE assignment:

http://seclists.org/oss-sec/2016/q2/589

Comment 1 Andrej Nemec 2016-06-29 12:04:49 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1351180]

Comment 2 Fedora Update System 2016-07-02 15:27:37 UTC
php-5.6.23-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 3 Fedora Update System 2016-07-02 19:22:26 UTC
php-5.6.23-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2016-07-02 19:27:44 UTC
php-5.6.23-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 5 Huzaifa S. Sidhpurwala 2016-07-11 10:07:15 UTC
Analysis:

This is triggered when a very large image created by imagecreate() is passed to imagepalettetotruecolor(), which triggers an integer overflow followed by heap-buffer overflow.

From a php point of view, this needs to be triggered by an attacker controlled imagecreate(), which is very unlikely situation.

Comment 8 errata-xmlrpc 2016-11-03 21:05:17 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:2598 https://rhn.redhat.com/errata/RHSA-2016-2598.html

Comment 10 errata-xmlrpc 2016-11-15 11:41:27 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS

Via RHSA-2016:2750 https://rhn.redhat.com/errata/RHSA-2016-2750.html


Note You need to log in before you can comment on or make changes to this bug.