tagline: Confidence in the Connected World
CIS Logo
HomeResourcesAdvisoriesMultiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

MS-ISAC ADVISORY NUMBER:

2017-060

DATE(S) ISSUED:

07/07/2017

OVERVIEW:

Multiple vulnerabilities have been discovered in PHP, the most severe of which could allow an attacker to execute arbitrary code. PHP is a programming language originally designed for use in web-based applications with HTML content. PHP supports a wide variety of platforms and is used by numerous web-based software applications. Successfully exploiting the most severe of these vulnerabilities could allow for remote attackers to execute arbitrary code in the context of the affected application. Failed exploitation could result in a denial-of-service condition.

THREAT INTELLIGENCE:

There are currently no reports of these vulnerabilities being exploited in the wild. There is known proof-of-concept code for these vulnerabilities.

SYSTEMS AFFECTED:

  • PHP 5.6 prior to 5.6.31
  • PHP 7.0 prior to 7.0.21
  • PHP 7.1 prior to 7.1.7

RISK:

Government:
  • Large and medium government entities: HIGH
  • Small government entities: HIGH
Businesses:
  • Large and medium business entities: HIGH
  • Small business entities: HIGH
Home Users:
LOW

TECHNICAL SUMMARY:

PHP has released updates that address multiple vulnerabilities, the most severe of which could allow for arbitrary code execution. These vulnerabilities include:

Prior to 5.6.31

  • Fixed bug #73807 (Performance problem with processing post request over 2000000 chars).
  • Fixed bug #74111 (Heap buffer overread (READ: 1) finish_nested_data from unserialize).
  • Fixed bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability).
  • Fixed bug #74819 (wddx_deserialize() heap out-of-bound read via php_parse_date()).
  • Fixed bug #74435 (Buffer over-read into uninitialized memory).
  • Add oniguruma upstream fix (CVE-2017-9224, CVE-2017-9226, CVE-2017-9227, CVE-2017-9228, CVE-2017-9229)
  • Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
  • Fixed bug #74087 (Segmentation fault in PHP7.1.1(compiled using the bundled PCRE library)).
  • Fixed bug #74145 (wddx parsing empty boolean tag leads to SIGSEGV).

Prior to 7.0.21

  • Fixed bug #74738 (Multiple [PATH=] and [HOST=] sections not properly parsed).
  • Fixed bug #74658 (Undefined constants in array properties result in broken properties).
  • Fixed bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability).
  • Fixed bug #74101, bug #74614 (Unserialize Heap Use-After-Free (READ: 1) in zval_get_type).
  • Fixed bug #74111 (Heap buffer overread (READ: 1) finish_nested_data from unserialize).
  • Fixed bug #74819 (wddx_deserialize() heap out-of-bound read via php_parse_date()).
  • Fixed bug #74639 (implement clone for DatePeriod and DateInterval).
  • Fixed bug #69373 (References to deleted XPath query results).
  • Fixed bug #74435 (Buffer over-read into uninitialized memory).
  • Fixed bug #73473 (Stack Buffer Overflow in msgfmt_parse_message).
  • Fixed bug #74705 (Wrong reflection on Collator::getSortKey and collator_get_sort_key).
  • Add oniguruma upstream fix (CVE-2017-9224, CVE-2017-9226, CVE-2017-9227, CVE-2017-9228, CVE-2017-9229)
  • Fixed bug #74663 (Segfault with opcache.memory_protect and validate_timestamp).
  • Fixed bug #74720 (pkcs7_en/decrypt does not work if x1a is used in content).
  • Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
  • Fixed bug #74673 (Segfault when cast Reflection object to string with undefined constant).
  • Fixed bug #74478 (null coalescing operator failing with SplFixedArray).
  • Fixed bug #74598 (ftp:// wrapper ignores context arg).
  • Fixed bug #74386 (Phar::construct reflection incorrect).
  • Fixed bug #74679 (Incorrect conversion array with WSDL_CACHE_MEMORY).
  • Fixed bug #74556 (stream_socket_get_name() returns '').**

Prior to 7.1.7

  • Fixed bug #74738 (Multiple [PATH=] and [HOST=] sections not properly parsed).
  • Fixed bug #74658 (Undefined constants in array properties result in broken properties).
  • Fixed bug #74101, bug #74614 (Unserialize Heap Use-After-Free (READ: 1) in zval_get_type).
  • Fixed bug #74111 (Heap buffer overread (READ: 1) finish_nested_data from unserialize).
  • Fixed bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability).
  • Fixed bug #74819 (wddx_deserialize() heap out-of-bound read via php_parse_date()).
  • Fixed bug #69373 (References to deleted XPath query results).
  • Fixed bug #74435 (Buffer over-read into uninitialized memory).
  • Fixed bug #73473 (Stack Buffer Overflow in msgfmt_parse_message).
  • Fixed bug #74705 (Wrong reflection on Collator::getSortKey and collator_get_sort_key).
  • Fixed bug #73634 (grapheme_strpos illegal memory access).
  • Add oniguruma upstream fix (CVE-2017-9224, CVE-2017-9226, CVE-2017-9227, CVE-2017-9228, CVE-2017-9229)
  • Fixed bug #74663 (Segfault with opcache.memory_protect and validate_timestamp).
  • Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
  • Fixed bug #74087 (Segmentation fault in PHP7.1.1(compiled using the bundled PCRE library)).
  • Fixed bug #74673 (Segfault when cast Reflection object to string with undefined constant).
  • Fixed bug #74478 (null coalescing operator failing with SplFixedArray).
  • Fixed bug #74708 (Invalid Reflection signatures for random_bytes and random_int).
  • Fixed bug #73648 (Heap buffer overflow in substr).
  • Fixed bug #74598 (ftp:// wrapper ignores context arg).
  • Fixed bug #74386 (Phar::construct reflection incorrect).
  • Fixed bug #74679 (Incorrect conversion array with WSDL_CACHE_MEMORY).
  • Fixed bug #74556 (stream_socket_get_name() returns ''). **

Successfully exploiting the most severe of these vulnerabilities could allow for remote attackers to execute arbitrary code in the context of the affected application. Failed exploitation could result in a denial-of-service condition.

RECOMENDATIONS:

We recommend the following actions be taken:

  • Upgrade to the latest version of PHP immediately, after appropriate testing.
  • Verify no unauthorized system modifications have occurred on system before applying patch.
  • Apply the principle of Least Privilege to all systems and services.
  • Remind users not to visit websites or follow links provided by unknown or untrusted sources.

REFERENCES:

Get Email Updates When Cyber Threats Like This Arise

Arrow Subscribe to Advisories

Protect Your Systems from Cyber Threats Like This

CIS Controls That Help Avoid This Issue Arrow CIS Control 4: Continuous Vulnerability Assessment and Remediation Arrow CIS Control 18: Application Software Security