Bug 1473822 (CVE-2017-7890)

Summary: CVE-2017-7890 php: Buffer over-read from unitialized data in gdImageCreateFromGifCtx function
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abhgupta, fedora, hhorak, jorton, leonfauster, ravpatil, rcollet, sardella, tiwillia, webstack-team
Target Milestone: ---Keywords: Reopened, Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: php 5.6.31, php 7.0.21, php 7.1.7 Doc Type: If docs needed, set a value
Doc Text:
A data leak was found in gdImageCreateFromGifCtx() in GD Graphics Library used in PHP before 5.6.31 and 7.1.7. An attacker could craft a malicious GIF image and read up to 762 bytes from stack.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 03:17:40 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: 1473823, 1536012, 1537128, 1554537    
Bug Blocks: 1491035, 1493963    

Description Pedro Sampaio 2017-07-21 19:15:32 UTC
A flaw was found in php. The GIF decoding function gdImageCreateFromGifCtx in gd_gif_in.c (which can be reached with a call to the imagecreatefromstring() function) uses constant-sized color tables of size 3 * 256, but does not zero-out these arrays before use. This flaw could lead to a information leak through a specially crafted image with bogus color table.

Upstream bug:

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

Upstream patch:

http://git.php.net/?p=php-src.git;a=commit;h=018092125538782b25d3ab6b036f0c8d5968f757
http://git.php.net/?p=php-src.git;a=commit;h=8dc4f4dc9e44d1cbfe4654aa6e0dc27c94913938
https://bugs.php.net/patch-display.php?bug=74435&patch=fix-74435-php-7.0&revision=1497970038

References:

http://php.net/ChangeLog-5.php

Comment 1 Pedro Sampaio 2017-07-21 19:16:06 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1473823]

Comment 2 Raphael Sanchez Prudencio 2017-10-25 16:20:36 UTC
Statement:

Red Hat Product Security has rated this issue as having Moderate security impact. This issue is not currently planned to be addressed in future updates. We recommend avoiding usage of the functions gdImageCreateFromGifCtx() and imagecreatefromstring() as they can lead to stack data leak.

For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

Comment 3 Ravindra Patil 2018-01-05 17:47:32 UTC
Is it possible to get more details on why this issue would not be fixed ?

Comment 8 errata-xmlrpc 2018-03-06 21:41:08 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

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

Comment 10 Andrej Nemec 2018-04-03 09:08:16 UTC
*** Bug 1562758 has been marked as a duplicate of this bug. ***

Comment 11 errata-xmlrpc 2018-05-03 05:07:50 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