Bug 1377344 (CVE-2016-7417) - CVE-2016-7417 php: Missing type check when unserializing SplArray
Summary: CVE-2016-7417 php: Missing type check when unserializing SplArray
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2016-7417
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: 1377366 1554899
Blocks: 1377365
TreeView+ depends on / blocked
 
Reported: 2016-09-19 13:17 UTC by Adam Mariš
Modified: 2019-09-29 13:56 UTC (History)
14 users (show)

Fixed In Version: php 5.6.26, php 7.0.11
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-10-12 09:11:04 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:1296 None None None 2018-05-03 05:05:20 UTC

Description Adam Mariš 2016-09-19 13:17:08 UTC
It was found that the return value is not checked and used on spl_array_get_dimension_ptr_ptr.

Vulnerable code:

static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
{
....
HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); <--- here is no check ht with NULL

}

Upstream bug:

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

Upstream patch:

https://github.com/php/php-src/commit/ecb7f58a069be0dec4a6131b6351a761f808f22e?w=1

CVE assignment:

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

Comment 1 Adam Mariš 2016-09-19 13:37:55 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1377366]

Comment 2 Huzaifa S. Sidhpurwala 2016-10-12 09:11:04 UTC
This issue happens when untrusted input is unserialized.  Doing so it documented as being unsafe:

  http://php.net/manual/en/function.unserialize.php

  Do not pass untrusted user input to unserialize(). Unserialization can
  result in code being loaded and executed due to object instantiation and
  autoloading, and a malicious user may be able to exploit this. Use a safe,
  standard data interchange format such as JSON (via json_decode() and
  json_encode()) if you need to pass serialized data to the user.

Comment 4 errata-xmlrpc 2018-05-03 05:05:09 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


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