Bug 1404723 (CVE-2016-9933)

Summary: CVE-2016-9933 php, gd: Stack overflow in gdImageFillToBorder on truecolor images
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: abhgupta, databases-maint, dmcphers, fedora, hhorak, jialiu, jokerman, jorton, kseifried, lmeyer, mmccomas, mskalick, rcollet, sardella, tiwillia, trepik, webstack-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: php 5.6.28, php 7.0.13, php 7.1.0, gd 2.2.2 Doc Type: If docs needed, set a value
Doc Text:
An infinite recursion flaw was found in the gdImageFillToBorder() function from the gd library; also used by PHP imagefilltoborder() function, when passing a negative integer as the color parameter, triggering a stack overflow. A remote attacker with ability to force a negative color identifier when calling the function could crash the PHP application, causing a Denial of Service.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-21 09:06:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1404737, 1554854    
Bug Blocks: 1404738    

Description Adam Mariš 2016-12-14 13:46:59 UTC
When negative color values are passed to gdImageFillToBorder(), it can lead to infinite recursion, since the recursion termination condition will not necessarily be met.

Upstream bug:

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

PHP patch:

https://github.com/php/php-src/commit/863d37ea66d5c960db08d6f4a2cbd2518f0f80d1

libgd patch:

https://github.com/libgd/libgd/commit/77f619d48259383628c3ec4654b1ad578e9eb40e

CVE assignment:

http://seclists.org/oss-sec/2016/q4/658

Comment 1 Adam Mariš 2016-12-14 14:19:06 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1404737]

Comment 3 Cedric Buissart 2017-02-21 09:08:50 UTC
Statement:

Red Hat Product Security has rated this issue as having Low security impact. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

Comment 5 errata-xmlrpc 2018-05-03 05:05:25 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.3 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS

Via RHSA-2018:1296 https://access.redhat.com/errata/RHSA-2018:1296