Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

ITS Advisory Number: 
2018-102
Date(s) Issued: 
Friday, October 12, 2018
Subject: 
Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution
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 arbitrary code execution in the context of the affected application. Depending on the privileges associated with the application, an attacker could install programs; view, change, or delete data; or create new accounts with full user rights. 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.

Systems Affected: 
  • PHP 7.2 prior to 7.2.11

  • PHP 7.1 prior to 7.1.23

RISK
GOVERNMENT
Large and medium government entities: 
High
Small government entities: 
High
BUSINESS
Large and medium business entities: 
High
Small business entities: 
High
Home Users: 
Low
Description: 

Multiple vulnerabilities have been discovered in PHP, the most severe of which could allow an attacker to execute arbitrary code. Details of these vulnerabilities are as below:

 

Version 7.2.11:

  • Bug (Compile-time evaluation of disabled function in apache causes segfault).

  • Bug (foreach inconsistent if array modified during loop).

 

Version 7.2.11 & Version 7.1.23:

  • Bug (iconv_mime_encode Q-encoding longer than it should be).

  • Bug (Wrong error message when fopen FTP wrapped fails to open data connection).

  • Bug (Wrong exception being thrown when using ReflectionMethod).

  • Bug (Bindto IPv6 works with file_get_contents but fails with stream_socket_client).

  • Bug (php_zlib_inflate_filter() may not update bytes_consumed).

  • Bug (array_reduce is slow when $carry is large array).

  • Bug (posix_getgrnam fails to print details of group).

  • Bug (Use curl_multi_wait() so that timeouts are respected).

  • Bug (ZendOPcache.MemoryBase periodically deleted by the OS).

  • Bug (Segfault in shutdown function after memory limit error).

  • Bug (method_exists on SPL iterator passthrough method corrupts memory). 

 

Successfully exploiting the most severe of these vulnerabilities could allow for arbitrary code execution in the context of the affected application. Depending on the privileges associated with the application, an attacker could install programs; view, change, or delete data; or create new accounts with full user rights. Failed exploitation could result in a denial-of-service condition.

Actions: 
  • Verify no unauthorized system modifications have occurred on system before applying patch.

  • After appropriate testing, immediately upgrade to the latest version of PHP.

  • 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: 

NOTE: Visiting these links may trigger an IDS signature match for a Possible Encrypted Webshell Download. This is potentially a false positive alert that is matching content on the pages below.

PHP:
http://php.net/ChangeLog-7.php#7.2.11
http://php.net/ChangeLog-7.php#7.1.23