Bug 1359718 (CVE-2016-6291) - CVE-2016-6291 php: Out-of-bounds access in exif_process_IFD_in_MAKERNOTE
Summary: CVE-2016-6291 php: Out-of-bounds access in exif_process_IFD_in_MAKERNOTE
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2016-6291
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1359837 1789043
Blocks: 1359830
TreeView+ depends on / blocked
 
Reported: 2016-07-25 10:49 UTC by Adam Mariš
Modified: 2020-01-17 15:50 UTC (History)
13 users (show)

Fixed In Version: php 5.5.38, php 5.6.24, php 7.0.9
Clone Of:
Environment:
Last Closed: 2016-09-26 19:59:56 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2750 0 normal SHIPPED_LIVE Moderate: rh-php56 security, bug fix, and enhancement update 2016-11-15 16:40:02 UTC

Description Adam Mariš 2016-07-25 10:49:05 UTC
An out-of-bounds access due to lack of size check of buffer may lead to memory buffer overflow.

Upstream bug:

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

Upstream patch:

http://git.php.net/?p=php-src.git;a=commit;h=eebcbd5de38a0f1c2876035402cb770e37476519

CVE assignment:

http://seclists.org/oss-sec/2016/q3/137

Comment 1 Adam Mariš 2016-07-25 14:12:34 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1359837]

Comment 2 Huzaifa S. Sidhpurwala 2016-08-05 06:06:41 UTC
Analysis:

In the affected code snippet:

offset_diff = 2 + NumDirEntries*12 + 4 - php_ifd_get32u(dir_start+10, ImageInfo->motorola_intel);

The output from the php_ifd_get32u() function and the NumDirEntries are attacker controlled, via a specially-crafted JPG image. This results in offset_diff being controlled by the user. Later in the code offset_diff is used to read the IFD tag, which could ultimately lead to OOB Read.

For successful exploitation, a specially crafted JPG image, needs to be read by the PHP script, via exif_read_data() function.

Comment 3 Remi Collet 2016-08-05 06:12:13 UTC
For memory, the recent exif CVE introduce a regression in MakerNote parser.

Regression fixed in:

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

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

Comment 4 errata-xmlrpc 2016-11-15 11:43:29 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.